Redirect to url with trailing slash, WITHOUT the protocol and host. #945
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.
Crow does not know the correct protocol when behind a reverse proxy. So instead, simply redirect to the same url and add a trailing slash.
Regarding #915
I've just realised that this fails when behind a reverse proxy.
Situation: running crowcpp as a HTTP behind a HTTPS reverse proxy
Crow wants to redirect.
It sets the location to the full URL, including protocol.
It assumes http:// is correct, as that is what it is running.
But, it needs https:// to correctly hit the reverse proxy...
Why do we need to specify the host? Is there a good reason?
I couldn't see any reasoning given in prior commits or issues.
967adf0#diff-83f8db2c08b899a7b155ca1ddbef781d51babff4553c79cd20fb3a216ffc7780R937
4cdde73#diff-cce8b59e628bdbbe6a329eea27b56b908c8a1d5926a4b44f697f39a301046c93L1402
07042b5#diff-83f8db2c08b899a7b155ca1ddbef781d51babff4553c79cd20fb3a216ffc7780R677