use URI::HTTPS to generate HTTPS redirects #864
Merged
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 deploying my app, I noticed the callback URL (after this redirect) was stalling, trying to load
http://my-app.herokuapp.com:443/api/auth/twitter/callback
. Playing withURI::HTTP.build
andURI::HTTPS.build
, I noticed thescheme
kwarg is ignoredIt seems like the best solution is to switch which
build()
we are using based on the request scheme. I modeled my change after this PR fog/fog#2159 which seems to be the same issue. I was unable to write a test because I don't thinkrequest_via_redirect
orget_via_redirect
supports having a scheme likehttps
.