Skip to content

Commit

Permalink
fix: superfluous response.WriteHeader call
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Stewart <christian@aperture.us>
  • Loading branch information
paralin committed Jan 2, 2025
1 parent 17988ae commit 631c978
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions srpc/server-http.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {

c, err := websocket.Accept(w, r, &websocket.AcceptOptions{})
if err != nil {
w.WriteHeader(500)
_, _ = w.Write([]byte(err.Error() + "\n"))
// NOTE: the error is already written with http.Error
// w.WriteHeader(500)
// _, _ = w.Write([]byte(err.Error() + "\n"))
return
}
defer c.Close(websocket.StatusInternalError, "closed")
Expand Down

0 comments on commit 631c978

Please sign in to comment.