From: Zdenek Dohnal Date: Mon, 16 Dec 2024 15:35:22 +0000 (+0100) Subject: scheduler: Fix removing Server header from HTTP if requested X-Git-Tag: v2.4.12~37^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1116%2Fhead;p=thirdparty%2Fcups.git scheduler: Fix removing Server header from HTTP if requested Use `httpSetDefaultField()` in `cupsdAcceptClient()` to do the trick. Fixes #1111 --- diff --git a/CHANGES.md b/CHANGES.md index 08e3ee8037..9fba982994 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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`. diff --git a/scheduler/client.c b/scheduler/client.c index 233f9017d2..e61f050053 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -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");