]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
scheduler: Fix `ServerTokens None`
authorZdenek Dohnal <zdohnal@redhat.com>
Tue, 17 Dec 2024 12:23:48 +0000 (13:23 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Tue, 17 Dec 2024 12:23:48 +0000 (13:23 +0100)
Fixes #1111

CHANGES.md
scheduler/client.c

index 5d3c7eae05e54bd17454bd82ec0245c0bf880489..314557053afe74490d863f3244d0285d0483768f 100644 (file)
@@ -117,6 +117,7 @@ Changes in CUPS v2.5b1 (YYYY-MM-DD)
 - Fixed `Host` header regression (Issue #967)
 - Fixed DNS-SD lookups of local services with Avahi (Issue #970)
 - Fixed debug printfs PID substitution support (Issue #1066)
+- Fixed `ServerToken None` in scheduler (Issue #1111)
 - Fixed CGI program initialization and validation of form checkbox and text
   fields.
 - Fixed finishing support in ippeveps.
index ab3d835e25045d9007ef95d3080e5453ba226fa5..fc92d17416f9eb206b6d76ad75905097744d8d5a 100644 (file)
@@ -318,6 +318,13 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
     con->serverport = httpAddrGetPort(&(lis->address));
   }
 
+ /*
+  * Apply ServerHeader if any...
+  */
+
+  if (ServerHeader)
+    httpSetDefaultField(con->http, HTTP_FIELD_SERVER, ServerHeader);
+
  /*
   * Add the connection to the array of active clients...
   */
@@ -2111,9 +2118,6 @@ cupsdSendHeader(
     code = HTTP_STATUS_OK;
   }
 
-  if (ServerHeader)
-    httpSetField(con->http, HTTP_FIELD_SERVER, ServerHeader);
-
   if (code == HTTP_STATUS_METHOD_NOT_ALLOWED)
     httpSetField(con->http, HTTP_FIELD_ALLOW, "GET, HEAD, OPTIONS, POST, PUT");