Closed Bug 1221110 Opened 10 years ago Closed 10 years ago

"You've been banned" page is cached in load balancer for anon users

Categories

(developer.mozilla.org Graveyard :: General, defect)

All
Other
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwhitlock, Assigned: groovecoder)

References

Details

(Whiteboard: [specification][type:bug])

What did you do? ================ 1. Created user jwhitlock_test on https://developer.mozilla.org 2. Banned user [1] 3. Visited a page as the banned user [2] 4. Visited the same page in an private browsing session [1] https://developer.mozilla.org/en-US/profiles/jwhitlock_test [2] https://developer.mozilla.org/en-US/docs/User%3Ajwhitlock%3Aspam_test What happened? ============== The private browsing session also got the "You've Been Banned" page instead of the page content. Logged-in users get the original content. What should have happened? ========================== Anonymous users should get the original content as well. Is there anything else we should know? ====================================== The BanMiddleware [3] needs to communicate that a page should not be cached [3] https://github.com/mozilla/kuma/blob/master/kuma/users/middleware.py
Not sure I did this right. How did you ban the user? Locally, when I created a user ban in the django admin site and re-visited the home page as the banned user, I got redirected to /en-US/users/account/inactive - not the "You've Been Banned" page.
Flags: needinfo?(jwhitlock)
I used two browsers (for instance, Firefox and Safari). One was logged into the to-be-banned user, looking at a page under /en-US/docs. One was logged in as an admin, looking at the users profile page. In the admin browser, I selected "BAN USER", which took me to the Django admin to add a reason and save the ban. In the now-banned user browser, I refreshed the page. I suspect the homepage display logic is doing some interesting stuff, and you should use a plain wiki page under /en-US/docs.
Flags: needinfo?(jwhitlock)
Commits pushed to master at https://github.com/mozilla/kuma https://github.com/mozilla/kuma/commit/d0caae0ab63ee751c3ea1bdfa6b78562d7b7c23e fix bug 1221110 - add_never_cache on ban responses https://github.com/mozilla/kuma/commit/9e07e418afeb5d17e44c052b492e0ebeebe81d50 bug 1221110 - test Expires value (for Travis) https://github.com/mozilla/kuma/commit/1b32c98cb47dee2f0154e513631e8a763b1a63f2 Merge pull request #3624 from mozilla/ban-cache-1221110 fix bug 1221110 - private, no-cache ban responses r=robhudson
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.