docs: clarify that sub protocols are not set via responseHeader arg.

This commit is contained in:
Matt Silverlock 2020-08-22 14:03:32 -07:00 committed by GitHub
parent 873e67e4d5
commit 78ab81e242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -115,8 +115,8 @@ func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header
// Upgrade upgrades the HTTP server connection to the WebSocket protocol. // Upgrade upgrades the HTTP server connection to the WebSocket protocol.
// //
// The responseHeader is included in the response to the client's upgrade // The responseHeader is included in the response to the client's upgrade
// request. Use the responseHeader to specify cookies (Set-Cookie) and the // request. Use the responseHeader to specify cookies (Set-Cookie). To specify
// application negotiated subprotocol (Sec-WebSocket-Protocol). // subprotocols supported by the server, set Upgrader.Subprotocols directly.
// //
// If the upgrade fails, then Upgrade replies to the client with an HTTP error // If the upgrade fails, then Upgrade replies to the client with an HTTP error
// response. // response.