Fix gated communities being unviewable by treating them as quarantined

This commit is contained in:
dom 2023-02-17 10:11:06 +01:00
parent 35504eda14
commit c6614997a6
2 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,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 {

View File

@ -144,7 +144,7 @@ pub async fn community(req: Request<Body>) -> Result<Response<Body>, String> {
})
}
Err(msg) => match msg.as_str() {
"quarantined" => quarantine(req, sub_name),
"quarantined" | "gated" => quarantine(req, sub_name),
"private" => error(req, format!("r/{} is a private community", sub_name)).await,
"banned" => error(req, format!("r/{} has been banned from Reddit", sub_name)).await,
_ => error(req, msg).await,