8000 `$_SERVER['SERVER_NAME']` may contain port which is not standard behaviour · Issue #423 · symfony-cli/symfony-cli · GitHub
[go: up one dir, main page]

Skip to content

$_SERVER['SERVER_NAME'] may contain port which is not standard behaviour #423

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

Closed
siketyan opened this issue Jan 31, 2024 · 0 comments · Fixed by #426
Closed

$_SERVER['SERVER_NAME'] may contain port which is not standard behaviour #423

siketyan opened this issue Jan 31, 2024 · 0 comments · Fixed by #426

Comments

@siketyan
Copy link
Contributor
siketyan commented Jan 31, 2024

With Symfony Local Server, I got the value of 127.0.0.1:8000 for $_SERVER['SERVER_NAME']. This is not standard behaviour; it will be 127.0.0.1 instead in other platforms regardless of which port the request is coming to.

This is caused by the behaviour of http.Request.Host:

	// ...
	// It may be of the form "host:port". ...
	Host string

https://pkg.go.dev/net/http#Request

@siketyan siketyan changed the title `$_SERVER['SERVER_NAME $_SERVER['SERVER_NAME'] may contain port which is not standard behaviour Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0