fix: return correct rate limit response
This commit is contained in:
1 parent
535665ca1b
commit
b32503d29f
1 file changed
+2
-1
@@ -239,6 +239,7 @@ impl Fairing for RatelimitFairing {
|
||||
request.remote().map(|x| x.ip())
|
||||
);
|
||||
|
||||
request.set_method(Method::Get);
|
||||
request.set_uri(Origin::parse("/ratelimit").unwrap())
|
||||
}
|
||||
}
|
||||
@@ -259,7 +260,7 @@ impl Fairing for RatelimitFairing {
|
||||
response.set_raw_header("X-RateLimit-Remaining", remaining.to_string());
|
||||
response.set_raw_header("X-RateLimit-Reset-After", reset.to_string());
|
||||
}
|
||||
Outcome::Failure(_) => {}
|
||||
Outcome::Failure(_) => response.set_status(Status::TooManyRequests),
|
||||
Outcome::Forward(_) => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user