Skip to content

Commit

Permalink
Merge pull request #44 from libp2p/fix/double-error-write
Browse files Browse the repository at this point in the history
fix: don't try to write an error twice
  • Loading branch information
Stebalien committed May 25, 2019
2 parents d43aa73 + a2d70a7 commit 8eef3f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/transport/websocket/listener.go
Expand Up @@ -26,7 +26,7 @@ func (l *listener) serve() {
func (l *listener) ServeHTTP(w http.ResponseWriter, r *http.Request) {
c, err := upgrader.Upgrade(w, r, nil)
if err != nil {
http.Error(w, "Failed to upgrade websocket", 400)
// The upgrader writes a response for us.
return
}

Expand Down

0 comments on commit 8eef3f7

Please sign in to comment.