net/http: document outgoing Host header origin in more places #34124
What version of Go are you using (
The text was updated successfully, but these errors were encountered:
We can document the current behavior more, but I'm very reluctant to change the behavior more at this point.
We currently have two fields we consult for the Host header. First Request.Host, else Request.URL.Host.
This is documented on Request.URL:
We could document that more on Request.Header and Request.Host too.
You're proposing to add a third level in there (Request.Header["Host"]) between the Request.Host and Request.URL.Host. That might be intuitive to some, but it's also just more complexity and compatibility support to maintain going forward. (And might catch other implementations by surprise?)
So we probably shouldn't do anything.
I'd accept a documentation change, though.