[sys] Include explicit URL ports in the Host header by Arthur031221 · Pull Request #13060 · HaxeFoundation/haxe · GitHub
Skip to content

[sys] Include explicit URL ports in the Host header - #13060

Open
Arthur031221 wants to merge 1 commit into
HaxeFoundation:developmentfrom
Arthur031221:fix-sys-http-host-port-s2
Open

Arthur031221 wants to merge 1 commit into
HaxeFoundation:developmentfrom
Arthur031221:fix-sys-http-host-port-s2

Conversation

@Arthur031221

Copy link
Copy Markdown

Fixes #13031.

Users of sys.Http contacting geckodriver on localhost:4444 received HTTP 500 because the generated Host header omitted :4444.

This builds on the patch @danielp96 posted in issue 13031.

The regression checks seven HTTP and HTTPS URL forms, including implicit ports, explicit default ports, alternate ports, and a URL without a scheme. It captures the request through a supplied socket and restores native streams before cleanup. With the original serialization line, five header assertions fail; all 14 assertions pass with this change. The original geckodriver reproduction printed ERROR and Http Error #500 before the fix, then DATA and {"value":{"message":"","ready":true}} after it.

Full unit suites passed on the interpreter, C++, Python (both outputs), PHP, Neko, JavaScript, Lua and JVM. The PHP CI entry point also passed its miscellaneous, unit and system tests.

Co-authored-by: Daniel 17953536+danielp96@users.noreply.github.com

Keep the request-capture socket compatible with native cleanup.

Co-authored-by: Daniel <17953536+danielp96@users.noreply.github.com>
@Arthur031221

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sys] sys.Http.hx doens't add port number to the request 'Host' header.

1 participant