Explorar o código

Improve Upgrader.Upgrade doc

Gary Burd %!s(int64=9) %!d(string=hai) anos
pai
achega
5c91b59efa
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      server.go

+ 3 - 0
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")