]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* modules/aaa/mod_auth_digest.c (add_auth_info): Don't add
authorJoe Orton <jorton@apache.org>
Mon, 6 Jul 2026 12:52:41 +0000 (12:52 +0000)
committerJoe Orton <jorton@apache.org>
Mon, 6 Jul 2026 12:52:41 +0000 (12:52 +0000)
  (Proxy-)Authentication-Info headers to 401/407 responses.

GitHub: PR #661

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1935954 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_auth_digest.c

index c18c4b55fdeb690e50800b0fb7fe7560baf392dc..cef5574d28545a9b3cc9bc7099398ebeff1d9e13 100644 (file)
@@ -1650,8 +1650,14 @@ static int add_auth_info(request_rec *r)
         return OK;
     }
 
-    /* setup nextnonce
-     */
+    /* Don't add Authentication-Info for 401/407 responses. */
+    if (apr_table_get(r->err_headers_out,
+                      (r->proxyreq == PROXYREQ_PROXY)
+                      ? "Proxy-Authenticate" : "WWW-Authenticate")) {
+        return OK;
+    }
+
+    /* Set up nextnonce for one-time-nonces and expiring-nonce cases. */
     if (conf->nonce_lifetime > 0) {
         /* send nextnonce if current nonce will expire in less than 30 secs */
         if ((r->request_time - resp->nonce_time) > (conf->nonce_lifetime-NEXTNONCE_DELTA)) {