In http://golang.org/src/pkg/net/http/request.go#L560
there is code that is dealing with the possibility of an
incoming 'standard' HTTP request (path only) or an
incoming proxy request (with a full URL specified).
I'm not understanding why the code then deletes the
Host record from req.Header map. Could someone
explain the reason for that operation on line 571?
560 // RFC2616: Must treat 561 // GET /index.html HTTP/1.1 562 // Host: www.google.com 563 // and 564 // GET http://www.google.com/index.html HTTP/1.1 565 // Host: doesntmatter 566 // the same. In the second case, any Host line is ignored. 567 req.Host = req.URL.Host 568 if req.Host == "" { 569 req.Host = req.Header.get("Host") 570 } 571 delete(req.Header, "Host")
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.