@@ -107,7 +107,7 @@ func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header
107
107
//
108
108
// The responseHeader is included in the response to the client's upgrade
109
109
// 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).
111
111
//
112
112
// If the upgrade fails, then Upgrade replies to the client with an HTTP error
113
113
// response.
@@ -131,7 +131,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
131
131
}
132
132
133
133
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" )
135
135
}
136
136
137
137
checkOrigin := u .CheckOrigin
@@ -144,7 +144,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
144
144
145
145
challengeKey := r .Header .Get ("Sec-Websocket-Key" )
146
146
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" )
148
148
}
149
149
150
150
subprotocol := u .selectSubprotocol (r , responseHeader )
@@ -212,7 +212,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
212
212
p = append (p , computeAcceptKey (challengeKey )... )
213
213
p = append (p , "\r \n " ... )
214
214
if c .subprotocol != "" {
215
- p = append (p , "Sec-Websocket -Protocol: " ... )
215
+ p = append (p , "Sec-WebSocket -Protocol: " ... )
216
216
p = append (p , c .subprotocol ... )
217
217
p = append (p , "\r \n " ... )
218
218
}
0 commit comments