@@ -107,7 +107,7 @@ func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header
107107//
108108// The responseHeader is included in the response to the client's upgrade
109109// request. Use the responseHeader to specify cookies (Set-Cookie) and the
110- // application negotiated subprotocol (Sec-Websocket -Protocol).
110+ // application negotiated subprotocol (Sec-WebSocket -Protocol).
111111//
112112// If the upgrade fails, then Upgrade replies to the client with an HTTP error
113113// response.
@@ -131,7 +131,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
131131 }
132132
133133 if _ , ok := responseHeader ["Sec-Websocket-Extensions" ]; ok {
134- return u .returnError (w , r , http .StatusInternalServerError , "websocket: application specific 'Sec-Websocket -Extensions' headers are unsupported" )
134+ return u .returnError (w , r , http .StatusInternalServerError , "websocket: application specific 'Sec-WebSocket -Extensions' headers are unsupported" )
135135 }
136136
137137 checkOrigin := u .CheckOrigin
@@ -144,7 +144,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
144144
145145 challengeKey := r .Header .Get ("Sec-Websocket-Key" )
146146 if challengeKey == "" {
147- return u .returnError (w , r , http .StatusBadRequest , "websocket: not a websocket handshake: `Sec-Websocket -Key' header is missing or blank" )
147+ return u .returnError (w , r , http .StatusBadRequest , "websocket: not a websocket handshake: `Sec-WebSocket -Key' header is missing or blank" )
148148 }
149149
150150 subprotocol := u .selectSubprotocol (r , responseHeader )
@@ -212,7 +212,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
212212 p = append (p , computeAcceptKey (challengeKey )... )
213213 p = append (p , "\r \n " ... )
214214 if c .subprotocol != "" {
215- p = append (p , "Sec-Websocket -Protocol: " ... )
215+ p = append (p , "Sec-WebSocket -Protocol: " ... )
216216 p = append (p , c .subprotocol ... )
217217 p = append (p , "\r \n " ... )
218218 }
0 commit comments