Skip to content

Remove HTTP 0.9 server support #54930

Closed
Closed

Description

@pitrou
BPO 10721
Nosy @loewis, @warsaw, @rhettinger, @orsenthil, @pitrou, @giampaolo, @merwok, @vadmium, @sigmavirus24, @Lukasa
Files
  • http09server.patch
  • http09server.v2.patch
  • http09server.v3.patch
  • http09server.v4.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2010-12-16.18:21:42.506>
    labels = ['3.7', 'type-bug', 'library']
    title = 'Remove HTTP 0.9 server support'
    updated_at = <Date 2016-11-24.03:10:59.340>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2016-11-24.03:10:59.340>
    actor = 'martin.panter'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2010-12-16.18:21:42.506>
    creator = 'pitrou'
    dependencies = []
    files = ['20077', '44066', '45258', '45617']
    hgrepos = []
    issue_num = 10721
    keywords = ['patch']
    message_count = 13.0
    messages = ['124145', '124149', '124166', '124184', '221636', '221637', '261962', '261963', '272320', '272410', '272435', '279643', '281601']
    nosy_count = 12.0
    nosy_names = ['loewis', 'jhylton', 'barry', 'rhettinger', 'orsenthil', 'pitrou', 'giampaolo.rodola', 'stutzbach', 'eric.araujo', 'martin.panter', 'icordasc', 'Lukasa']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue10721'
    versions = ['Python 3.7']

    Linked PRs

    Activity

    1. pitrou commented on Dec 16, 2010

      @pitrou
      MemberAuthor

      http.server has support for old-style HTTP 0.9 requests ("command path" without a version string). This issue proposes to remove this support, since there are probably no clients around which still issue such requests.

      See bpo-10711 for the client side.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Dec 16, 2010
    3. merwok commented on Dec 16, 2010

      @merwok
      Member

      LGTM

    4. loewis commented on Dec 17, 2010

      loewismannequin
      Mannequin

      The question really is whether we want or want not to support RFC 1945 (i.e HTTP/1.0). If we want to support it, we also must comply to section 3.1, which says

      The version of an HTTP message is indicated by an HTTP-Version field
      in the first line of the message. If the protocol version is not
      specified, the recipient must assume that the message is in the
      simple HTTP/0.9 format.

      If we then choose to not support HTTP/0.9 (after recognizing that the message is HTTP/0.9), we must then reject the request. According to RFC 2145, we then may send back error 505 (HTTP version not supported).

    5. orsenthil commented on Dec 17, 2010

      @orsenthil
      Member

      If a client sends a request without specifying the version, GET /, then the Python server should behave like other common servers are behaving, namely support rfc 1945 for HTTP 1.0 spec and return the response without headers.

      Removing the HTTP 0.9 from the http.client is okay. But punishing *any client* for not sending the correct request is not so desirable, especially when there are other servers which are lenient to his behavior for whatever reasons.

      So, I am not a firm +1 to this. We should arrive a conclusion and then go about with the change. Martin's point is valid here too.

    6. BreamoreBoy commented on Jun 26, 2014

      BreamoreBoymannequin
      Mannequin

      How, if at all, has the requirement for HTTP 0.9 support changed since this issue was first raised?

    7. Lukasa commented on Jun 26, 2014

      Lukasamannequin
      Mannequin

      To answer your question, Mark, RFC 7230 has removed the expectation that HTTP/1.1 servers will be able to support HTTP/0.9 requests.

    8. vadmium commented on Mar 18, 2016

      @vadmium
      Member

      Does this need any deprecation cycle, or can we just remove everything immediately in 3.6?

      I suspect that the HTTP 0.9 support never properly worked, but I don’t have enough info to be sure. Wouldn’t a HTTP 0.9 request send b"GET <path>\r\n" with a single line, and then wait for a response? If so, Python’s server hangs waiting for a second blank line (or EOF), so the protocol will deadlock.

      In any case, I would be in favour of removing HTTP 0.9 support. Senthil: do you know of actual clients that do HTTP 0.9 requests?

      I left a review comment. The patch will also need manual merging with current code.

    9. vadmium commented on Mar 18, 2016

      @vadmium
      Member

      Also I guess documentation should be added somewhere, even if there is no deprecation step.

    10. vadmium commented on Aug 10, 2016

      @vadmium
      Member

      FWIW I doubt HTTP 1.1 ever required support for other HTTP versions; see for instance <https://tools.ietf.org/html/rfc2068#section-19.7\>.

      This v2 patch adds another test that includes what I understand is a true HTTP 0.9 request (although the mock connection infrastructure closes the connection before receiving the response, so you don’t see any deadlock). This is based on <https://tools.ietf.org/html/rfc1945#page-22\>, which includes only one CRLF newline. I also added an entry to the What’s New page.

    11. rhettinger commented on Aug 11, 2016

      @rhettinger
      Contributor

      There is so very little code in support of HTTP/0.9 that I don't think we get any benefit from removing it. So why bother with the churn? It is cleaner to just leave it place.

    12. vadmium commented on Aug 11, 2016

      @vadmium
      Member

      There are a few small benefits from removing it, but I am not too fussed if we decide to leave it.

      • If we keep it, should we fix it so that it doesn’t deadlock? Otherwise, we carry around buggy and untested code that claims to be a HTTP 0.9 server but isn’t. Keeping it as it is doesn’t feel “clean” to me.

      • Easy way to resolve bug reports like bpo-26578.

      • Potentially slightly easier to maintain the rest of the code in the future.

      If we do keep it, I would like to add comments clarifying that it does not implement the real HTTP 0.9 protocol.

    13. vadmium commented on Oct 29, 2016

      @vadmium
      Member

      Here is a slightly updated patch I have been sitting on. I think the main difference was tweaks to the documentation.

      bpo-28548 would also benefit if the HTTP 0.9 code was removed. The presence of the HTTP 0.9 code means a suboptimal response is sent in some error cases. IMO it would be better if the server responded using HTTP 1.0, where we can use error codes like “400 Bad request”. The current code will not use HTTP 1.0 unless it sees that the client supports it.

    14. vadmium commented on Nov 24, 2016

      @vadmium
      Member

      V4 patch adjusting to recent code change.

      Raymond: Given the problems caused by the current code, would you reconsider your opposition?

      Otherwise, what do you think should be the future of the code? Should we fix it so that it handles real HTTP 0.9 requests, or just admit that it doesn’t implement the protocol properly.

    15. transferred this issue fromon Apr 10, 2022
    16. serhiy-storchaka commented on Jul 3, 2026

      @serhiy-storchaka
      Member

      The deadlock on HTTP/0.9 requests was fixed in gh-70765.

      The remaining defect is that error responses to malformed request lines are sent in the bare HTTP/0.9 style, without a status line and headers. #152980 fixes this.

      After that this issue can be closed, since HTTP/0.9 support now works and removing it was objected to.

    17. added a commit that references this issue on Jul 5, 2026
    18. added 3 commits that reference this issue on Jul 5, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions