Skip to content
Snippets Groups Projects
Commit 8a0b35e9 authored by Rohith's avatar Rohith
Browse files

Method Check

Ensuring the http.Hijacker is implemented by the ResponseWriter
parent d2d9c43e
No related branches found
No related tags found
No related merge requests found
......@@ -268,7 +268,10 @@ func tryUpdateConnection(req *http.Request, writer http.ResponseWriter, endpoint
defer tlsConn.Close()
// step: we need to hijack the underlining client connection
clientConn, _, err := writer.(http.Hijacker).Hijack()
clientConn, ok, err := writer.(http.Hijacker).Hijack()
if !ok {
return errors.New("writer does not implement http.Hijacker method")
}
if err != nil {
return err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment