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.
Proxito: handle http to https redirects for all requests #10199
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
Proxito: handle http to https redirects for all requests #10199
Changes from 1 commit
cdb88ad
72fe380
523a010
a663462
c5a54a9
2434760
4f76856
97a5f09
15e0806
dd7eb94
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We are using a
constants.py
on each Django application. Probably makes sense to keep that same pattern here as well?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.
Do we copy them for any particular reason?
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.
We are extending this list below, we don't want to change the original list.
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.
I think it's not clear what
force
means in this context. Probably it's worth to rename this attribute to something likepublic=
orprivate=
depending what's the best default.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.
For me force is more clear than public or private, since we are forcing the request to be cached or not depending on the method being called.
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.
My point is that sometimes
force=True
means to force to be public and some othersforce=True
means to be private. See https://github.com/readthedocs/readthedocs.org/pull/10199/files/c5a54a93eeb027a4187edae5c5c9610d7fbbe155#diff-47aa393923b9e640f34198f21bb776acd52797a770630d8c5a5bfd63346931c1R61Something more explicit here would be better in my opinion. If you like the
force
word, probablyforce="public"
andforce="private"
is a better middle ground and still pretty clear.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.
But they are used in different functions, the name of the function already specifies if the request will be forced to be public or private (cache_response, private_response), that's why it's just a boolean, we aren't using one function to cache the response or make it private, we are using two different functions.
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.
Yeah, I saw that. IMO, it's still hard to realize what I am forcing to when passing the boolean, that's why I raised this comment here. I got confused while doing the review.
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.
Is this a real case or we are logging this here just for debugging purposes?
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.
It doesn't make sense to cache a response if we don't have a way to purge it using cache tags.
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.
This would be good as a comment, or even better in the logging message.
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.
Same here. As a user calling
private_response(response, force)
is hard to know/understand/guess that theforce=
argument does. I'd like if can be explicit here.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.
What other name do you suggest? To me force is clear, especially since the default is always True.