@@ -209,12 +209,13 @@ func NewOAuthProxy(opts *Options, validator func(string) bool) *OAuthProxy {
209209 proxy := NewWebSocketOrRestReverseProxy(u, opts, auth)
210210 serveMux.Handle(path, proxy)
211211 case "static":
212+ responseCode, err := strconv.Atoi(host)
213+ if err != nil {
214+ logger.Printf("unable to convert %q to int, use default \"200\"", host)
215+ responseCode = 200
216+ }
217+
212218 serveMux.HandleFunc(path, func(rw http.ResponseWriter, req *http.Request) {
213− responseCode, err := strconv.Atoi(host)
214− if err != nil {
215− logger.Printf("unable to convert %q to int, use default \"200\"", host)
216− responseCode = 200
217− }
218219 rw.WriteHeader(responseCode)
219220 fmt.Fprintf(rw, "Authenticated")
220221 })