Send request data early
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -53,11 +53,11 @@ EXPOSE 8080/udp
|
|||||||
|
|
||||||
ENV JWT_PRIVATE_KEY_SEED="${GOAWAY_JWT_PRIVATE_KEY_SEED}"
|
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} \
|
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} \
|
--policy ${GOAWAY_POLICY} --client-ip-header "${GOAWAY_CLIENT_IP_HEADER}" --backend-ip-header "${GOAWAY_BACKEND_IP_HEADER}" \
|
||||||
--cache ${GOAWAY_CACHE} \
|
--cache "${GOAWAY_CACHE}" \
|
||||||
--dnsbl ${GOAWAY_DNSBL} \
|
--dnsbl "${GOAWAY_DNSBL}" \
|
||||||
--challenge-template ${GOAWAY_CHALLENGE_TEMPLATE} --challenge-template-theme ${GOAWAY_CHALLENGE_TEMPLATE_THEME} \
|
--challenge-template "${GOAWAY_CHALLENGE_TEMPLATE}" --challenge-template-theme "${GOAWAY_CHALLENGE_TEMPLATE_THEME}" \
|
||||||
--slog-level ${GOAWAY_SLOG_LEVEL} \
|
--slog-level "${GOAWAY_SLOG_LEVEL}" \
|
||||||
--acme-autocert ${GOAWAY_ACME_AUTOCERT} \
|
--acme-autocert "${GOAWAY_ACME_AUTOCERT}" \
|
||||||
--backend ${GOAWAY_BACKEND}
|
--backend "${GOAWAY_BACKEND}"
|
||||||
@@ -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 {
|
for _, c := range state.Challenges {
|
||||||
key := state.GetChallengeKeyForRequest(c.Name, data.Expires, r)
|
key := state.GetChallengeKeyForRequest(c.Name, data.Expires, r)
|
||||||
result, err := c.VerifyChallengeToken(state.publicKey, key, 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("Accept-CH", "Sec-CH-UA, Sec-CH-UA-Platform")
|
||||||
//w.Header().Set("Critical-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)
|
state.Mux.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user