@@ -71,7 +71,7 @@ func (h *WebsocketdServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
7171
7272 if h .Config .CommandName != "" || h .Config .UsingScriptDir {
7373 hdrs := req .Header
74- upgradeRe := regexp .MustCompile (" (?i)(^|[,\\ s])Upgrade($|[,\\ s])" )
74+ upgradeRe := regexp .MustCompile (` (?i)(^|[,\s])Upgrade($|[,\s])` )
7575 // WebSocket, limited to size of h.forks
7676 if strings .ToLower (hdrs .Get ("Upgrade" )) == "websocket" && upgradeRe .MatchString (hdrs .Get ("Connection" )) {
7777 if h .noteForkCreated () == nil {
@@ -118,7 +118,7 @@ func (h *WebsocketdServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
118118
119119 } else {
120120 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 )
122122 }
123123 return
124124 }
@@ -162,7 +162,7 @@ func (h *WebsocketdServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
162162 cgiHandler .ServeHTTP (w , req )
163163 } else {
164164 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 )
166166 }
167167 return
168168 }
@@ -228,7 +228,6 @@ func (h *WebsocketdServer) noteForkCompled() {
228228 panic ("Cannot deplet number of allowed forks, something is not right in code!" )
229229 }
230230 }
231- return
232231}
233232
234233func checkOrigin (req * http.Request , config * Config , log * LogScope ) (err error ) {
0 commit comments