]> Cypherpunks repositories - gostls13.git/commit
websocket: return an error HTTP response for bad websocket request.
authorFumitoshi Ukai <ukai@google.com>
Thu, 3 Nov 2011 03:13:39 +0000 (14:13 +1100)
committerAndrew Gerrand <adg@golang.org>
Thu, 3 Nov 2011 03:13:39 +0000 (14:13 +1100)
commitde3d64725288c4baa083b804d51f4d7ef35ea130
treeb1da64de5ad3d9c5d620aa6a862c03b7453fdf5d
parentbc440f1bfe4ddda6247cef5cc8a9f14ecb3b1373
websocket: return an error HTTP response for bad websocket request.

websocket spec had changed server-side requiements to return
an HTTP response with an appropriate error code (such as 400 Bad
Request) when it finds client did not send a handshake that matches
websocket protocol, rather than just closing connection.
It needs to flush out response before closing connection.
Fixes issues 2396.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5318072
src/pkg/websocket/server.go
src/pkg/websocket/websocket_test.go