fix: expose ratelimit headers via cors (#496)

This commit is contained in:
Angelo Kontaxis
2026-01-25 19:43:06 +00:00
committed by GitHub
parent 0dc5442498
commit a1a21252d0
5 changed files with 34 additions and 1 deletions

View File

@@ -34,6 +34,12 @@ pub async fn router() -> Router<AppState> {
let cors = CorsLayer::new()
.allow_methods([Method::POST])
.allow_headers(AllowHeaders::mirror_request())
.expose_headers(vec![
"X-RateLimit-Limit".try_into().unwrap(),
"X-RateLimit-Bucket".try_into().unwrap(),
"X-RateLimit-Remaining".try_into().unwrap(),
"X-RateLimit-Reset-After".try_into().unwrap(),
])
.allow_origin(Any);
Router::new()