@@ -53,19 +53,19 @@ func AcceptInsecureOrigin() AcceptOption {
5353
5454func verifyClientRequest (w http.ResponseWriter , r * http.Request ) error {
5555 if ! headerValuesContainsToken (r .Header , "Connection" , "Upgrade" ) {
56- err := xerrors .Errorf ("websocket: protocol violation: Connection header does not contain Upgrade: %q " , r .Header .Get ("Connection" ))
56+ err := xerrors .Errorf ("websocket: protocol violation: Connection header %q does not contain Upgrade" , r .Header .Get ("Connection" ))
5757 http .Error (w , err .Error (), http .StatusBadRequest )
5858 return err
5959 }
6060
6161 if ! headerValuesContainsToken (r .Header , "Upgrade" , "WebSocket" ) {
62- err := xerrors .Errorf ("websocket: protocol violation: Upgrade header does not contain websocket: %q " , r .Header .Get ("Upgrade" ))
62+ err := xerrors .Errorf ("websocket: protocol violation: Upgrade header %q does not contain websocket" , r .Header .Get ("Upgrade" ))
6363 http .Error (w , err .Error (), http .StatusBadRequest )
6464 return err
6565 }
6666
6767 if r .Method != "GET" {
68- err := xerrors .Errorf ("websocket: protocol violation: handshake request method is not GET: %q " , r .Method )
68+ err := xerrors .Errorf ("websocket: protocol violation: handshake request method %q is not GET" , r .Method )
6969 http .Error (w , err .Error (), http .StatusBadRequest )
7070 return err
7171 }
@@ -88,7 +88,7 @@ func verifyClientRequest(w http.ResponseWriter, r *http.Request) error {
8888// Accept accepts a WebSocket handshake from a client and upgrades the
8989// the connection to WebSocket.
9090// Accept will reject the handshake if the Origin is not the same as the Host unless
91- // InsecureAcceptOrigin is passed.
91+ // the AcceptInsecureOrigin option is passed.
9292// Accept uses w to write the handshake response so the timeouts on the http.Server apply.
9393func Accept (w http.ResponseWriter , r * http.Request , opts ... AcceptOption ) (* Conn , error ) {
9494 var subprotocols []string
0 commit comments