python / python/cpython

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

未關閉
#132,741 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

stdlib type-bug
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

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

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,使用 issue 中的 python3 -m http.servernc 重現該請求,然後追蹤 http.server 對 absolute-form request-target 的請求處理流程。當所示請求收到 200 OK 而不是 404 File not found,且符合所參照 RFC 的行為時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
backend, networking
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。