Fix wrong url when behind proxy#647
Open
lezab wants to merge 2 commits into
Open
Conversation
…ter understanding
…er path than on webapp server
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
First of all, I wanted to apologize because it seems I didn't follow the proper procedure for the pull request (submitting it directly to the dev branch).
So I closed the other PR and reopened this one. That also gave me a chance to fix a few minor issues along the way. I also made two separate commits to separate the proxy usage as a parameter from the problem relative to local url path.
So I answer here to your comments in the other PR :
The issue here is that when you develop an application that you want to distribute, you don’t know whether the user will run it behind a proxy or not. It seems to me that having this as a parameter could be usefull.
I also red the answers you did to #629.
The point is that, in some cases, this isn't enough. Setting
basURLand/orbaseURLPathdoesn't make a difference because thebuildWithBaseUrlPathfunction doesn't allow you to remove the installation directory from the beginning of$_SERVER['SCRIPT_NAME']or$_SERVER['REQUEST_URI'].Example:
The application is installed on : https://server.domain/my/install/folder/application/ (typically on linux/apache : /var/www/html/my/install/folder/application/ with root on /var/www/html/)
But accessed via reverse proxy by : https://application.domain/ (the reverse proxy is an another server with the virtual host “application” configured to act as rp on the url above)
The library says : “The response was received at https://application.domain/my/install/folder/application/login_sso instead of https://application.domain/login_sso” because $currentURL (in Response::isValid()) is wrong
I wrote a test as you suggested. I hope I made myself clearer this time.
Thaks for your attention.
Best regards