fix: case-insensitive Bearer token parsing in auth header #25

Merged
marfrit merged 1 commits from williams/lmcp:fix/case-insensitive-bearer-auth into master 2026-05-30 14:43:38 +00:00
Contributor

Problem

The MCP auth header regex ^Bearer rejects lowercase bearer tokens. Some HTTP clients send authorization: bearer <token> (lowercase scheme), causing spurious 401s even with a valid token.

Fix

Changed regex from ^Bearer to ^[Bb]earer to accept both Bearer and bearer.

This was tested live on the hertz production server — all four header case combinations (authorization/Authorization × Bearer/bearer) now return HTTP 200.

Closes #21

## Problem The MCP auth header regex `^Bearer` rejects lowercase `bearer` tokens. Some HTTP clients send `authorization: bearer <token>` (lowercase scheme), causing spurious 401s even with a valid token. ## Fix Changed regex from `^Bearer` to `^[Bb]earer` to accept both `Bearer` and `bearer`. This was tested live on the hertz production server — all four header case combinations (`authorization`/`Authorization` × `Bearer`/`bearer`) now return HTTP 200. Closes #21
williams added 1 commit 2026-05-30 12:55:40 +00:00
marfrit merged commit 3dd01e5313 into master 2026-05-30 14:43:38 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marfrit/lmcp#25