forked from encode/uvicorn
-
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.
Support disabling default Server and Date headers (encode#818)
* Support disabling default Server header (encode#688) Section 7.4.2 of RFC 7231 states that "an origin server MAY generate a Server field in its responses." The "MAY" means that sending this header is entirely optional. While the implementation of encode#321 allowed applications to override the Server header, there was no way to disable the Server header altogether. By default, uvicorn adds a Server header to each response that doesn't have one through other means. This change adds the server_header flag to Config, as well as the commandline option --no-server-header, through which this behaviour can be disabled. * Support disabling default Date header When an origin server does not have a sufficiently reliable clock, section 7.1.1.2 of RFC 7231 stipulates that it "MUST NOT" send a Date header field. By default, uvicorn adds a Date header to each response. This change adds the date_header flag to Config, as well as the commandline option --no-date-header, through which this behaviour can be disabled.
- Loading branch information
Showing
6 changed files
with
68 additions
and
6 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
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