GET, POST etc. with Uri-Host
chrysn opened this issue · 2 comments
Currently, coap-rs never sets the Uri-Host option. This behavior is independent of the value of the host portion of the URI passed in.
If a URI is decomposed into options and the host component (domain
in the source) is not an IP literal, it would be turned into a Uri-Host option according to RFC 7252 Section 6.4 item 5.
Not doing this becomes an issue for clients that interact with servers that do name based virtual hosting, as is often the case with reverse proxies as employed in NAT traversal.
As many systems do not require this option even when the IP address is resolved through DNS, it might be practical to offer methods like .post()
both in a variant that sets and one that does not set the Uri-Host. (Also, different people have different opinions of how optional it is to send it, the CoAP wiki has both sides (disclaimer: I wrote that)).
(CC @malishav with whom I encountered this).
The Uri-Host, Uri-Port, Uri-Path, and Uri-Query Options need to be implemented