]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
scheduler: Fix removing Server header from HTTP if requested 1116/head
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 16 Dec 2024 15:35:22 +0000 (16:35 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 16 Dec 2024 15:35:22 +0000 (16:35 +0100)
Use `httpSetDefaultField()` in `cupsdAcceptClient()` to do the trick.

Fixes #1111

CHANGES.md
scheduler/client.c

index 08e3ee8037ef5e0f0fee58861f0c96add1248b7d..9fba982994f98c473182b9cd65f08fcae457bba7 100644 (file)
@@ -9,6 +9,7 @@ Changes in CUPS v2.4.12 (YYYY-MM-DD)
 - Fixed a compressed file error handling bug (Issue #1070)
 - Fixed a bug in the make-and-model whitespace trimming code (Issue #1096)
 - Fixed a removal of IPP Everywhere permanent queue if installation failed (Issue #1102)
+- Fixed `ServerToken None` in scheduler (Issue #1111)
 - Fixed the default User-Agent string.
 - Fixed a recursion issue in `ippReadIO`.
 
index 233f9017d27ebfdce31416a5731c9bb9ec4ed9ff..e61f0500535c296bb7e4c19061967c51f94a1cac 100644 (file)
@@ -330,6 +330,13 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
     con->serverport = httpAddrPort(&(lis->address));
   }
 
+ /*
+  * Apply ServerHeader if any
+  */
+
+  if (ServerHeader)
+    httpSetDefaultField(con->http, HTTP_FIELD_SERVER, ServerHeader);
+
  /*
   * Add the connection to the array of active clients...
   */
@@ -2146,9 +2153,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");