Make gated subreddits accessible by treating them as quarantined (#722)

* Fix gated communities being unviewable by treating them as quarantined

* Show restriction reason in quarantine template

* Add `gated` checks for other requests
This commit is contained in:
domve 2023-02-26 08:40:32 +01:00 committed by GitHub
parent 0b39d4f059
commit eb07a2ce7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 14 deletions

View file

@ -142,7 +142,7 @@ fn request(method: &'static Method, path: String, redirect: bool, quarantine: bo
.header("Accept-Encoding", if method == Method::GET { "gzip" } else { "identity" })
.header("Accept-Language", "en-US,en;q=0.5")
.header("Connection", "keep-alive")
.header("Cookie", if quarantine { "_options=%7B%22pref_quarantine_optin%22%3A%20true%7D" } else { "" })
.header("Cookie", if quarantine { "_options=%7B%22pref_quarantine_optin%22%3A%20true%2C%20%22pref_gated_sr_optin%22%3A%20true%7D" } else { "" })
.body(Body::empty());
async move {