From e2fca2bf671d59f752361b41c68321f04b3b6d9c Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Wed, 25 Oct 2023 15:02:12 +0200 Subject: [PATCH] fix: expect free query auth token to start with "Bearer " --- common/src/indexer_service/http/request_handler.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/src/indexer_service/http/request_handler.rs b/common/src/indexer_service/http/request_handler.rs index c3e31f64..80d627e9 100644 --- a/common/src/indexer_service/http/request_handler.rs +++ b/common/src/indexer_service/http/request_handler.rs @@ -61,8 +61,9 @@ where } else if state.config.server.free_query_auth_token.is_some() && state.config.server.free_query_auth_token != headers - .get("free-query-auth-token") + .get("authorization") .and_then(|v| v.to_str().ok()) + .and_then(|s| s.strip_prefix("Bearer ")) .map(|s| s.to_string()) { return Err(IndexerServiceError::Unauthorized);