From 5c91b59efa232fa9a87b705d54101832c498a172 Mon Sep 17 00:00:00 2001 From: Gary Burd Date: Sun, 21 Feb 2016 13:34:30 -0800 Subject: [PATCH] Improve Upgrader.Upgrade doc --- server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server.go b/server.go index 3a9805f..85616c7 100644 --- a/server.go +++ b/server.go @@ -92,6 +92,9 @@ func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header // The responseHeader is included in the response to the client's upgrade // request. Use the responseHeader to specify cookies (Set-Cookie) and the // application negotiated subprotocol (Sec-Websocket-Protocol). +// +// If the upgrade fails, then Upgrade replies to the client with an HTTP error +// response. func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error) { if r.Method != "GET" { return u.returnError(w, r, http.StatusMethodNotAllowed, "websocket: method not GET")