Skip to content

Commit

Permalink
fix(client): don't catch network policy errors, since they indicate q… (
Browse files Browse the repository at this point in the history
  • Loading branch information
sigaloid authored Sep 25, 2024
1 parent 2d6ac78 commit e0d7837
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit e0d7837

Please sign in to comment.