Browse Source

fix http connect handling

pull/432/merge
Darien Raymond 8 years ago
parent
commit
72d5d68443
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
  1. 15
      proxy/http/server.go

15
proxy/http/server.go

@ -122,19 +122,8 @@ Start:
} }
func (s *Server) handleConnect(ctx context.Context, request *http.Request, reader io.Reader, writer io.Writer, dest v2net.Destination, dispatcher dispatcher.Interface) error { func (s *Server) handleConnect(ctx context.Context, request *http.Request, reader io.Reader, writer io.Writer, dest v2net.Destination, dispatcher dispatcher.Interface) error {
response := &http.Response{ _, err := writer.Write([]byte("HTTP/1.1 200 Connection established\n\n"))
Status: "200 OK", if err != nil {
StatusCode: 200,
Proto: "HTTP/1.1",
ProtoMajor: 1,
ProtoMinor: 1,
Header: http.Header(make(map[string][]string)),
Body: nil,
ContentLength: -1, // Don't send Content-Length in CONNECT.
Close: false,
}
response.Header.Set("Proxy-Connection", "close")
if err := response.Write(writer); err != nil {
return newError("failed to write back OK response").Base(err) return newError("failed to write back OK response").Base(err)
} }

Loading…
Cancel
Save