diff --git a/src/pkg/http/readrequest_test.go b/src/pkg/http/readrequest_test.go index adac86a47fb..79f8de70d3c 100644 --- a/src/pkg/http/readrequest_test.go +++ b/src/pkg/http/readrequest_test.go @@ -152,28 +152,6 @@ var reqTests = []reqTest{ noBody, "parse : empty url", }, - - // CONNECT method. - { - "CONNECT proxy.example.com:443 HTTP/1.0\r\n" + - "Host: proxy.example.com\r\n\r\n", - - &Request{ - Method: "CONNECT", - RawURL: "proxy.example.com:443", - URL: nil, - Proto: "HTTP/1.0", - ProtoMajor: 1, - ProtoMinor: 0, - Close: false, - ContentLength: 0, - Host: "proxy.example.com", - Form: Values{}, - }, - - noBody, - noError, - }, } func TestReadRequest(t *testing.T) { diff --git a/src/pkg/http/request.go b/src/pkg/http/request.go index cfde345f105..2917cc1e6e1 100644 --- a/src/pkg/http/request.go +++ b/src/pkg/http/request.go @@ -548,11 +548,8 @@ func ReadRequest(b *bufio.Reader) (req *Request, err os.Error) { return nil, &badStringError{"malformed HTTP version", req.Proto} } - isConnect := strings.ToUpper(req.Method) == "CONNECT" - if !isConnect { - if req.URL, err = ParseRequestURL(req.RawURL); err != nil { - return nil, err - } + if req.URL, err = ParseRequestURL(req.RawURL); err != nil { + return nil, err } // Subsequent lines: Key: value. @@ -569,9 +566,7 @@ func ReadRequest(b *bufio.Reader) (req *Request, err os.Error) { // GET http://www.google.com/index.html HTTP/1.1 // Host: doesntmatter // the same. In the second case, any Host line is ignored. - if !isConnect { - req.Host = req.URL.Host - } + req.Host = req.URL.Host if req.Host == "" { req.Host = req.Header.Get("Host") }