Ignore relative_url_root if generating prefix#20958
Closed
merhard wants to merge 1 commit intorails:4-2-stablefrom
Closed
Ignore relative_url_root if generating prefix#20958merhard wants to merge 1 commit intorails:4-2-stablefrom
merhard wants to merge 1 commit intorails:4-2-stablefrom
Conversation
When generating the url for a mounted engine through its proxy (e.g. foo.bar_path), the relative_url_root should not be used when generating the proxy’s url prefix. (fixes rails#20920)
Contributor
Author
|
@rafaelfranca, any chance to get this into v4.2.4? It is a fix for a regression in v4.2.3 |
|
When will this be merged and released? |
merhard
pushed a commit
to merhard/rails
that referenced
this pull request
Sep 23, 2015
When generating the url for a mounted engine through its proxy, the path should be the sum of three parts: 1. Any `SCRIPT_NAME` request header or the value of `relative_url_root`. 2. A prefix (the engine's mounted path). 3. The path of the named route inside the engine. Since commit rails@0703453, this has been broken. Instead, the path is the sum of four parts: 1. Any `SCRIPT_NAME` request header or the value of `relative_url_root`. 2. The value of `relative_url_root`. 3. A prefix (the engine's mounted path). 4. The path of the named route inside the engine. This commit fixes the regression by providing a benign truthy value for `options[:script_name]` (an empty string) when the prefix is being generated, avoiding the duplicate `relative_url_root` value in the final result. This resolves rails#20920, resolves rails#21459, and closes rails#20958
Contributor
Author
|
Fyi, I added a new pull request with another solution to the issue this attempts to solve. #21743 Hopefully one of these two solutions can be merged soon so the issue can be resolved. |
merhard
pushed a commit
to merhard/rails
that referenced
this pull request
Sep 28, 2015
When generating the url for a mounted engine through its proxy, the path should be the sum of three parts: 1. Any `SCRIPT_NAME` request header or the value of `relative_url_root`. 2. A prefix (the engine's mounted path). 3. The path of the named route inside the engine. Since commit rails@44ff031, this has been broken. Instead, the path is the sum of four parts: 1. Any `SCRIPT_NAME` request header or the value of `relative_url_root`. 2. The value of `relative_url_root`. 3. A prefix (the engine's mounted path). 4. The path of the named route inside the engine. This commit fixes the regression by providing a benign truthy value for `options[:script_name]` (an empty string) when the prefix is being generated, avoiding the duplicate `relative_url_root` value in the final result. This resolves rails#20920, resolves rails#21459, and closes rails#20958
Contributor
Author
|
Closing this in favor of #21804 |
|
can you please share a patch that I can apply in my app, right now |
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.
When generating the url for a mounted engine through its proxy (e.g. foo.bar_path), the relative_url_root should not be used when generating the proxy’s url prefix.
(fixes #20920)