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

gh-134168: http.server with HTTPS fails to bind IPv6 addresses and ignores --directory flag#134169

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ggqlq wants to merge11 commits intopython:main
base:main
Choose a base branch
Loading
fromggqlq:fix_http_cli
Open
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
use a mixin class
  • Loading branch information
@ggqlq
ggqlq committedMay 18, 2025
commit26539a81ca10c8055238bd58f6d0b4a0c58dca36
16 changes: 4 additions & 12 deletionsLib/http/server.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1039,7 +1039,7 @@ def test(HandlerClass=BaseHTTPRequestHandler,
parser.error(f"Failed to read TLS password file: {e}")

# ensure dual-stack is not disabled; ref #38907
classDualStackServer(ThreadingHTTPServer):
classDualStackServerMixin:

def server_bind(self):
# suppress exception when protocol is IPv4
Expand All@@ -1052,18 +1052,10 @@ def finish_request(self, request, client_address):
self.RequestHandlerClass(request, client_address, self,
directory=args.directory)

class HTTPSDualStackServer(ThreadingHTTPSServer):
def server_bind(self):
with contextlib.suppress(Exception):
self.socket.setsockopt(
socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
return super().server_bind()

def finish_request(self, request, client_address):
self.RequestHandlerClass(request, client_address, self,
directory=args.directory)
class HTTPDualStackServer(DualStackServerMixin, ThreadingHTTPServer): pass
class HTTPSDualStackServer(DualStackServerMixin, ThreadingHTTPSServer): pass

ServerClass = HTTPSDualStackServer if args.tls_cert elseDualStackServer
ServerClass = HTTPSDualStackServer if args.tls_cert elseHTTPDualStackServer

test(
HandlerClass=SimpleHTTPRequestHandler,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp