python / python/cpython

http.server does not accept "absolute-form" as "request-target"

Open
#132,741 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:
python3 -m http.server &
printf "GET http://127.0.0.1:8000/ HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n" | nc 127.0.0.1 8000

Expected: 200 OK
Got: 404 File not found

Reference:

[RFC 9112] (Section 3.2)
[RFC 7230] (Section 5.3)
[RFC 2616] (Section 5.1.2)

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the request with python3 -m http.server and nc from the issue, then trace the http.server request handling for an absolute-form request-target. Done means the shown request receives 200 OK instead of 404 File not found, consistent with the referenced RFC behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.