fix(client): don't catch network policy errors, since they indicate q… (#259)

This commit is contained in:
Matthew Esposito 2024-09-24 21:45:47 -04:00 committed by GitHub
parent 2d6ac78acf
commit e0d7837c02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -300,12 +300,6 @@ fn request(method: &'static Method, path: String, redirect: bool, quarantine: bo
.await;
};
// Special condition rate limiting - https://github.com/redlib-org/redlib/issues/229
if response.status() == StatusCode::FORBIDDEN && response.headers().get("retry-after").unwrap_or(&HeaderValue::from_static("0")).to_str().unwrap_or("0") == "0" {
force_refresh_token().await;
return Err("Rate limit - try refreshing soon".to_string());
}
match response.headers().get(header::CONTENT_ENCODING) {
// Content not compressed.
None => Ok(response),