Redirect protocol and host#150
Merged
joanniclaborde merged 7 commits intomasterfrom Nov 13, 2017
Merged
Conversation
pushred
approved these changes
Nov 10, 2017
| "continuation-local-storage": "~3.1.1", | ||
| "express": "3.1.x", | ||
| "express-expose": "SparkartGroupInc/express-expose#escape-script-ending-tag", | ||
| "express-expose": "sparkartgroupinc/express-expose#escape-script-ending-tag", |
Member
There was a problem hiding this comment.
Might as well use the new org name, sparkartgroup
| router.engine( DEFAULT_VIEW_EXTENSION, handlebars.engine ); | ||
| router.set( 'view engine', DEFAULT_VIEW_EXTENSION ); | ||
| router.set( 'views', paths.views ); | ||
| router.set( 'trust proxy', true ); // Use the X-Forwarded-* headers: https://expressjs.com/en/guide/behind-proxies.html |
Member
There was a problem hiding this comment.
Is this required by Fastly, or any other CDN?
Contributor
Author
There was a problem hiding this comment.
Without this, the HTTPS protocol doesn't seem to be detected by Solidus on Heroku, so HTTPS requests end up in redirect loops.
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.
Adds ability to redirect from and to a specific protocol and/or host. It is now possible to use objects for the
fromandtoproperties inredirects.js.If a
fromobject is used (instead of the usual string or regular expression), the following properties are available:protocol- If specified, the request's protocol must match for the whole redirect to match (httporhttps).host- If specified, the request's host must match for the whole redirect to match (for examplesite.com).path- The path to match, this is the same as the originalfrom. Defaults to*, to match all paths.If a
toobject is used (instead of the usual string or function), the following properties are available:protocol- If specified, will override the request's protocol.host- If specified, will override the request's host.url- The url to redirect to, this is the same as the originalto. Defaults to the request's url.Example to automatically redirect to HTTPS and from the root domain to the
wwwsubdomain: