Repository navigation
Deal with relative url root installations - #837
Closed
oliverguenther wants to merge 2 commits into
Closed
oliverguenther wants to merge 2 commits into
oliverguenther wants to merge 2 commits into
Conversation
This commit allows OmniAuth to handle relative url root installations by correctly prefixing the default `Strategy#request_path` and `Strategy#callback_path` with `SCRIPT_NAME` as provided by Rack. Also, in order to detect the full current path, uses `Rack::Request#path` instead of `#path_info`, as the latter does not include SCRIPT_NAME. A deeper question remains: What should happen with custom callback and request paths? I can't think of a case where a user with a relative url root installation would *not* want to prefix its paths, regardless of setting a custom path or not. However, since some people may have configured custom paths in order to deal with relative root, including this change may be breaking.
oliverguenther
added a commit
to oliverguenther/openproject
that referenced
this pull request
Feb 19, 2016
Using my own fork that contributes to the PR at omniauth/omniauth#837
sferik
force-pushed
the
master
branch
2 times, most recently
from
August 8, 2016 18:30
a5c7282 to
76feeea
Compare
|
Just ran into this issue in my own project; would love to see a fix like this. |
|
+1 this would be super useful! |
oliverguenther
added a commit
to opf/openproject
that referenced
this pull request
Jun 13, 2017
Fixes hashie warnings of the kind ``` You are setting a key that conflicts with a built-in method Foo#bar. ``` Warnings have been silenced in: omniauth/omniauth#874 Since our PR (omniauth/omniauth#837) has not been answered, we maintain our own fork.
This was referenced Jun 13, 2017
Contributor
Author
|
I've re-opened this on the current dev in #903 |
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.
This PR allows OmniAuth to transparently handle relative url root installations
by correctly prefixing the default
Strategy#request_pathandStrategy#callback_pathwithSCRIPT_NAMEas provided by Rack.Also, in order to detect the full current path, uses
Rack::Request#pathinstead of#path_info, as the latter does notinclude SCRIPT_NAME.
A deeper question remains: What should happen with custom callback and
request paths? I can't think of a case where a user with a relative url
root installation would not want to prefix its paths, regardless of
setting a custom path or not.
However, since some people may have configured custom paths in order to
deal with relative root, including this change may be breaking.
I have thus included a specific spec that asserts that custom request paths are not prefixed.
This deals with:
#767
#753
We've stumbled over these bugs while fixing our own OmniAuth relative url root path helpers over at opf/openproject#4169