-
Notifications
You must be signed in to change notification settings - Fork 264
Page URL: Fix handling of base url and reverse proxy forward prefix #566
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
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
458cdb8
Add tests for page.url with base url and reverse proxy trusted prefix
flexponsive ab11f87
Fix: page.url contains the base url twice
flexponsive 9f201d0
add test case for page url with proxy forwarded prefix only
flexponsive 262ec7c
skip proxy forward prefix on legacy symfony which does not support th…
flexponsive 1948dc3
make explicit that we are removing scheme and host from the full requ…
flexponsive File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think this can be changed to just using
fullUrl(), https://github.com/laravel/framework/blob/10.x/src/Illuminate/Http/Request.php#L116-L123Uh oh!
There was an error while loading. Please reload this page.
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.
fullUrlcorrectly takes care of the base url and forward prefix, but it also prepends the protocol and hostname. This may have an impact on the inertia clients for the different JavaScript frameworks. It causes 10 failures in theResponseTest, for example:The advantage of using fullUrl is that it would be more consistent, since the prop is already called
urlbut in reality only contains the path URI. But it is a potentially breaking change if JS clients assume they receive only the path URI. Also, detecting the protocol (https?) and actual client facing hostname can be a headache in a reverse proxy environment...@RobertBoes what do you prefer?
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.
Hmm yeah, you're right, didn't think about that
It shouldn't be, if the correct headers are sent and the
TrustProxiesmiddleware is set up properly (which is what you should do anyways if you're using a reverse proxy)