Skip to content

Commit a5b99ff

Browse files
authored
WFE: Only send Replay-Nonce for POSTs/newNonce endpoint. (#184)
Modern ACME only sends a Replay-Nonce in responses to GET/HEAD requests to the dedicated newNonce endpoint, or in replies to POST requests that consumed a nonce.
1 parent 80ae435 commit a5b99ff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wfe/wfe.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,12 @@ func (wfe *WebFrontEndImpl) HandleFunc(
195195
defaultHandler := http.StripPrefix(pattern,
196196
&topHandler{
197197
wfe: wfeHandlerFunc(func(ctx context.Context, logEvent *requestEvent, response http.ResponseWriter, request *http.Request) {
198-
response.Header().Set("Replay-Nonce", wfe.nonce.createNonce())
198+
// Modern ACME only sends a Replay-Nonce in responses to GET/HEAD
199+
// requests to the dedicated newNonce endpoint, or in replies to POST
200+
// requests that consumed a nonce.
201+
if request.Method == "POST" || pattern == noncePath {
202+
response.Header().Set("Replay-Nonce", wfe.nonce.createNonce())
203+
}
199204

200205
logEvent.Endpoint = pattern
201206
if request.URL != nil {

0 commit comments

Comments
 (0)