forked from valyala/fasthttp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow removal of the Server header in responses
his PR adds an option to the Server called `NoDefaultServerHeader` that allows a user to indicate that neither the Server's `Name` field nor the `defaultServerName` should be included in the Server's responses as a `Server` header by default. Now when `ResponseHeader.AppendBytes` is found to have an empty `server` field, it simply skips the `Server` header. Previously that method would write the `defaultServerName` when no value was found. The only code paths that took advantage of that were ones originating from `writeErrorResponse`, which now handles setting the server name directly. Fixes: valyala#221
- Loading branch information
1 parent
4b42074
commit d84d8ea
Showing
4 changed files
with
95 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters