Skip to content

Commit

Permalink
chore: recoverer middleware skip write header on upgrade connection (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fatelei committed Feb 20, 2023
1 parent 883aa98 commit 51068a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion middleware/recoverer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ func Recoverer(next http.Handler) http.Handler {
PrintPrettyStack(rvr)
}

w.WriteHeader(http.StatusInternalServerError)
if r.Header.Get("Connection") != "Upgrade" {
w.WriteHeader(http.StatusInternalServerError)
}
}
}()

Expand Down

0 comments on commit 51068a7

Please sign in to comment.