feat: forward Authorization header from request to downstream

Prioritize Authorization header from incoming request over environment
variable, allowing per-request API key routing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hotwa
2026-03-22 15:53:24 +08:00
parent 587e319520
commit 829682b98a
2 changed files with 6 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ const ollamaRoutes: FastifyPluginAsync = async (server: FastifyInstance) => {
return;
}
const response = await forwardChatRequest(body);
const response = await forwardChatRequest(body, request.headers.authorization);
reply.status(200).send(response);
} catch (error: any) {