Skip to content

Commit

Permalink
scheduler: Fix removing Server header from HTTP if requested
Browse files Browse the repository at this point in the history
Fixes #1111
  • Loading branch information
zdohnal authored Dec 17, 2024
2 parents 331a202 + 364171b commit 98ba14b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
10 changes: 7 additions & 3 deletions scheduler/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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...
*/
Expand Down Expand Up @@ -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");

Expand Down

0 comments on commit 98ba14b

Please sign in to comment.