Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

HTTPS server served byhttp.server ignores--directory argument #134176

Closed as duplicate of#134168
Labels
3.14bugs and security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@picnixz

Description

@picnixz

Bug report

Bug description:

Originally reported by@ggqlq in#134168 (comment)

The HTTPS server always uses the work path of current terminal as its root directory and ignores the--directory flag:

#HTTPS$./python -m http.server --tls-cert~/Projects/ssl/localhost.crt --tls-key~/Projects/ssl/localhost.key -d~/testServing HTTPS on 0.0.0.0 port 8000 (https://0.0.0.0:8000/) ...127.0.0.1 - - [18/May/2025 13:28:16] "GET / HTTP/1.1" 200 -$curl -k https://0.0.0.0:8000/<!DOCTYPE HTML><html lang="en"><head>#...</head><body><h1>Directory listing for /</h1><hr><ul><li><a href=".azure-pipelines/">.azure-pipelines/</a></li><li><a href=".coveragerc">.coveragerc</a></li><li><a href=".devcontainer/">.devcontainer/</a></li><li><a href=".editorconfig">.editorconfig</a></li><li><a href=".git/">.git/</a></li><li><a href=".gitattributes">.gitattributes</a></li><li><a href=".github/">.github/</a></li>#...#Filesin my cpython repo's root path</ul><hr></body></html>#HTTP$./python -m http.server -d~/testServing HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...127.0.0.1 - - [18/May/2025 13:24:30] "GET / HTTP/1.1" 200 -$curl http://0.0.0.0:8000/<!DOCTYPE HTML><html lang="en"><head>#...</head><body><h1>Directory listing for /</h1><hr><ul><li><a href="1">1</a></li><li><a href="2">2</a></li><li><a href="3">3</a></li></ul><hr></body></html>

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other, Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp