-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Add option to ignore SERVER_PORT getting added to url. #629
Conversation
I am not to sure about this since nginx/haproxy/php-fpm/whatever can (and probably should) be configured so the correct server port and IP trickles down to the application. See for example: https://serverfault.com/a/256205 However I am not against it, it's just adding another option 😄 What do you thing @Jean85? |
The |
True indeed! I guess the So: also taking into account the I still think the |
@malc0mn, no it should not since those headers can be set by anyone, including your end-users. This is why we're also not using the IP that comes in the X-Forwarded-IP header for example (#594). These should be validated correctly and that is (way) out of scope for the Sentry library. I think I'm fine adding the option, however I still believe the best way to resolve this is on the webserver/proxy configuration. But that's another discussion 😄 So if you could remove the X_Forward commit I can merge the original PR 😉 |
Okay, removed the last commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this since we scrapped the headers part
Thanks @malc0mn! |
You're welcome! |
Nowadays, running a site behind a reverse proxy is extremely common. When you are behind a reverse proxy, you cannot be sure that whatever is serving PHP is on a standard port (80 or 443, see #572). It can easily be 8080 or whatever is available/suitable for the hoster.
Blindly appending the port to the url in that case is annoying for developers when going through the logs.
An option to ignore the server port would help out immensly, so this pull request proposes to add
ignore_server_port
as an option defaulting to false to keep the current behavior.