From: Zdenek Dohnal Date: Tue, 17 Dec 2024 12:23:48 +0000 (+0100) Subject: scheduler: Fix `ServerTokens None` X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=260d48a6528b8a959931d0f50379c08faf911844;p=thirdparty%2Fcups.git scheduler: Fix `ServerTokens None` Fixes #1111 --- diff --git a/CHANGES.md b/CHANGES.md index 5d3c7eae05..314557053a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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. diff --git a/scheduler/client.c b/scheduler/client.c index ab3d835e25..fc92d17416 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -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");