node: fix wrong status code in ws (#35111)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

Fixes an issue where we would falsely return 400 when we should return
200 because the request was served successfully

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
cui 2026-06-10 14:30:52 +08:00 committed by GitHub
parent 43b7b4e8d9
commit 11f0a8318b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -209,7 +209,9 @@ func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if ws != nil && isWebsocket(r) { if ws != nil && isWebsocket(r) {
if checkPath(r, ws.prefix) { if checkPath(r, ws.prefix) {
ws.ServeHTTP(w, r) ws.ServeHTTP(w, r)
return
} }
http.Error(w, "not found", http.StatusNotFound)
return return
} }