]> Cypherpunks repositories - gostls13.git/commit
http: include Host header in requests, even with proxies
authorBrad Fitzpatrick <bradfitz@golang.org>
Sat, 21 May 2011 02:40:23 +0000 (19:40 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 21 May 2011 02:40:23 +0000 (19:40 -0700)
commite4b942245a5234dcc2ba88c8f974630e26b9f97a
tree749d7f5651ce1729363bd00a2344f8b9a773da1b
parent3230fd1469faa93fc3414ec7ee7cbc809daccd8f
http: include Host header in requests, even with proxies

A user pointed out that Go didn't work with their
corp proxy, always throwing 400 Bad Request errors.

Looking at the RFC 2616, Host is always required,
even with proxies.

The old code assumed that writing an absolute URL
in the first line of an HTTP request implied
that the Host header was no longer necessary.

Double-checked behavior with curl.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4539075
src/pkg/http/request.go
src/pkg/http/requestwrite_test.go