diff --git a/Dockerfile b/Dockerfile index e01dc39..d6358f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,11 +53,11 @@ EXPOSE 8080/udp ENV JWT_PRIVATE_KEY_SEED="${GOAWAY_JWT_PRIVATE_KEY_SEED}" -ENTRYPOINT /bin/go-away --bind ${GOAWAY_BIND} --bind-network ${GOAWAY_BIND_NETWORK} --socket-mode ${GOAWAY_SOCKET_MODE} \ - --policy ${GOAWAY_POLICY} --client-ip-header ${GOAWAY_CLIENT_IP_HEADER} --backend-ip-header ${GOAWAY_BACKEND_IP_HEADER} \ - --cache ${GOAWAY_CACHE} \ - --dnsbl ${GOAWAY_DNSBL} \ - --challenge-template ${GOAWAY_CHALLENGE_TEMPLATE} --challenge-template-theme ${GOAWAY_CHALLENGE_TEMPLATE_THEME} \ - --slog-level ${GOAWAY_SLOG_LEVEL} \ - --acme-autocert ${GOAWAY_ACME_AUTOCERT} \ - --backend ${GOAWAY_BACKEND} \ No newline at end of file +ENTRYPOINT /bin/go-away --bind "${GOAWAY_BIND}" --bind-network "${GOAWAY_BIND_NETWORK}" --socket-mode "${GOAWAY_SOCKET_MODE}" \ + --policy ${GOAWAY_POLICY} --client-ip-header "${GOAWAY_CLIENT_IP_HEADER}" --backend-ip-header "${GOAWAY_BACKEND_IP_HEADER}" \ + --cache "${GOAWAY_CACHE}" \ + --dnsbl "${GOAWAY_DNSBL}" \ + --challenge-template "${GOAWAY_CHALLENGE_TEMPLATE}" --challenge-template-theme "${GOAWAY_CHALLENGE_TEMPLATE_THEME}" \ + --slog-level "${GOAWAY_SLOG_LEVEL}" \ + --acme-autocert "${GOAWAY_ACME_AUTOCERT}" \ + --backend "${GOAWAY_BACKEND}" \ No newline at end of file diff --git a/lib/http.go b/lib/http.go index 229a6c3..8b09a1c 100644 --- a/lib/http.go +++ b/lib/http.go @@ -443,6 +443,8 @@ func (state *State) ServeHTTP(w http.ResponseWriter, r *http.Request) { }(), } + r = r.WithContext(context.WithValue(r.Context(), "_goaway_data", &data)) + for _, c := range state.Challenges { key := state.GetChallengeKeyForRequest(c.Name, data.Expires, r) result, err := c.VerifyChallengeToken(state.publicKey, key, r) @@ -479,8 +481,6 @@ func (state *State) ServeHTTP(w http.ResponseWriter, r *http.Request) { //w.Header().Set("Accept-CH", "Sec-CH-UA, Sec-CH-UA-Platform") //w.Header().Set("Critical-CH", "Sec-CH-UA, Sec-CH-UA-Platform") - r = r.WithContext(context.WithValue(r.Context(), "_goaway_data", &data)) - state.Mux.ServeHTTP(w, r) }