-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Onion location paths #733
Onion location paths #733
Conversation
6c8c4c2
to
2fd4957
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So right now if the footer_settings.securedrop_onion_address
is set to an onion address without https://
in the beginning (which is the case in createdevdata), the urljoin()
function technically just replaces the onion address with just the request.path. Hence only the path is returned in that case. I am not sure in which format onion address is saved in prod. Maybe can add a check of some sort to append https://
in the beginning?
I think there is a validator on the model itself: securedrop.org/common/models/settings.py Lines 43 to 52 in e67c78c
Though I also do see the benefit of ensuring we don't do the wrong thing in this middleware either, regardless of the overall format. |
Maybe create dev data is what needs to be changed. Hm. |
Possible. Hence marked it as a comment and not request changes. I think given the validator, probably safe to just update create dev data |
Added! Thanks for the review. |
66785d5
to
5cbaafc
Compare
The Onion Location Middleware requires this setting to act as a "base" URL in order to form the correct header value, so we need the `http://` in this setting. The validation already tries to make sure this happens, so we ought to have it in the default value as well.
5cbaafc
to
6c1997b
Compare
Given that @maeve-fpf is deploying the k8s powered version of this site tomorrow which will include nginx managed onion-location headers, this PR is no longer necessary (I didn't get my review together in time, whoops). Closing without merging. |
This pull request fixes the problem with the
Onion-Location
header always referring to the home page, rather than the page path requested by each individual page.Fixes #724