Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support disabling default Server and Date headers #818

Merged
merged 2 commits into from
Jun 11, 2021

Commits on Jun 10, 2021

  1. 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.
    stiiin committed Jun 10, 2021
    Configuration menu
    Copy the full SHA
    998504e View commit details
    Browse the repository at this point in the history
  2. 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.
    stiiin committed Jun 10, 2021
    Configuration menu
    Copy the full SHA
    4fec066 View commit details
    Browse the repository at this point in the history