Don't redirect to PhoneQuestion from HybridHandoff if referer is nil#9472
Closed
soniaconnolly wants to merge 1 commit intomainfrom
Closed
Don't redirect to PhoneQuestion from HybridHandoff if referer is nil#9472soniaconnolly wants to merge 1 commit intomainfrom
soniaconnolly wants to merge 1 commit intomainfrom
Conversation
We see that referer is nil if the user tries to visit idv_link_sent_url while still on HybridHandoff. Not sure why, but web search indicates that the user can turn off referer in the HTTP header, which would cause a redirect loop in #maybe_redirect_for_phone_question_ab_test. So this adds a check for nil referer in that method. [skip changelog] Co-authored-by: Doug Price <douglas.price@gsa.gov> Co-authored-by: Amir Reavis-Bey <amir.reavis-bey@gsa.gov> Co-authored-by: Jessica Dembe: <jessica.dembe@gsa.gov>
Contributor
Author
|
Closed in favor of refactor in #9461 |
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.
We see that referer is nil if the user tries to visit idv_link_sent_url while still on HybridHandoff. Not sure why, but web search indicates that the user can turn off referer in the HTTP header, which would cause a redirect loop in #maybe_redirect_for_phone_question_ab_test. So this adds a check for nil referer in that method.
Discovered while doing local testing for #9465
Research links:
https://api.rubyonrails.org/v5.0.1/classes/ActionController/Redirecting.html
https://blog.mozilla.org/security/2015/01/21/meta-referrer/
NOTE: we are reconsidering our life choices and may just re-implement #maybe_redirect_for_phone_question_ab_test to depend on a session value