@@ -71,7 +71,7 @@ func (h *WebsocketdServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
71
71
72
72
if h .Config .CommandName != "" || h .Config .UsingScriptDir {
73
73
hdrs := req .Header
74
- upgradeRe := regexp .MustCompile (" (?i)(^|[,\\ s])Upgrade($|[,\\ s])" )
74
+ upgradeRe := regexp .MustCompile (` (?i)(^|[,\s])Upgrade($|[,\s])` )
75
75
// WebSocket, limited to size of h.forks
76
76
if strings .ToLower (hdrs .Get ("Upgrade" )) == "websocket" && upgradeRe .MatchString (hdrs .Get ("Connection" )) {
77
77
if h .noteForkCreated () == nil {
@@ -118,7 +118,7 @@ func (h *WebsocketdServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
118
118
119
119
} else {
120
120
log .Error ("http" , "Max of possible forks already active, upgrade rejected" )
121
- http .Error (w , "429 Too Many Requests" , 429 )
121
+ http .Error (w , "429 Too Many Requests" , http . StatusTooManyRequests )
122
122
}
123
123
return
124
124
}
@@ -162,7 +162,7 @@ func (h *WebsocketdServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
162
162
cgiHandler .ServeHTTP (w , req )
163
163
} else {
164
164
log .Error ("http" , "Fork not allowed since maxforks amount has been reached. CGI was not run." )
165
- http .Error (w , "429 Too Many Requests" , 429 )
165
+ http .Error (w , "429 Too Many Requests" , http . StatusTooManyRequests )
166
166
}
167
167
return
168
168
}
@@ -228,7 +228,6 @@ func (h *WebsocketdServer) noteForkCompled() {
228
228
panic ("Cannot deplet number of allowed forks, something is not right in code!" )
229
229
}
230
230
}
231
- return
232
231
}
233
232
234
233
func checkOrigin (req * http.Request , config * Config , log * LogScope ) (err error ) {
0 commit comments