Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ext/http): do not set localhost to hostname unnecessarily #24777

Merged

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jul 29, 2024

This PR changes when to cause the hostname substition of 0.0.0.0 -> localhost.

Currently we substitute localhost to the hostname on windows before calling options.onListen, which prevents the users to do more advanced thing using hostname string like denoland/std#5558. This PR changes it not to substitute it when the user provide onListen callback.

closes #24776
unblocks denoland/std#5558

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM again (once Windows test is fixed).

@kt3k kt3k requested a review from bartlomieju August 20, 2024 03:53
@kt3k
Copy link
Member Author

kt3k commented Aug 20, 2024

@bartlomieju Does this change look reasonable?

ext/http/00_serve.ts Outdated Show resolved Hide resolved
@kt3k kt3k merged commit e799c28 into denoland:main Sep 5, 2024
17 checks passed
@kt3k kt3k deleted the fix-http-serve-do-not-set-localhost-unnecessarily branch September 5, 2024 05:13
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.

http serve: pass the hostname as is to user-defined onListen handler
3 participants