fix crash

gnutls_nghttp2
fangdingjun 6 years ago
parent 985f8a80b5
commit 75c3cb0fcc

@ -160,7 +160,12 @@ func (h *handler) handleCONNECT(w http.ResponseWriter, r *http.Request) {
if r.ProtoMajor == 1 { if r.ProtoMajor == 1 {
// HTTP/1.1 // HTTP/1.1
hj, _ := w.(http.Hijacker) hj, ok := w.(http.Hijacker)
if !ok {
w.WriteHeader(http.StatusNotFound)
return
}
conn1, _, _ := hj.Hijack() conn1, _, _ := hj.Hijack()
fmt.Fprintf(conn1, "%s 200 connection established\r\n\r\n", r.Proto) fmt.Fprintf(conn1, "%s 200 connection established\r\n\r\n", r.Proto)

Loading…
Cancel
Save