Skip to content

Normalize bearer token header format#129

Merged
patvice merged 1 commit intomainfrom
use-B-on-bearer-token
Feb 23, 2026
Merged

Normalize bearer token header format#129
patvice merged 1 commit intomainfrom
use-B-on-bearer-token

Conversation

@patvice
Copy link
Copy Markdown
Owner

@patvice patvice commented Feb 23, 2026

This PR updates token header formatting to always use canonical Bearer for bearer tokens, while preserving other token types.

In auth.rb:

  • Token#to_header now normalizes token_type so empty or case-insensitive "bearer" becomes "Bearer".
  • Non-bearer token types (for example DPoP) are unchanged.

Added token_spec.rb with coverage for:

  • default bearer formatting,
  • lowercase "bearer" normalization to "Bearer",
  • preserving non-bearer token types.
  • This makes auth headers consistent with the standard Bearer scheme without changing behavior for other schemes.

closes #126

@patvice patvice merged commit 3d6386e into main Feb 23, 2026
7 checks passed
@patvice patvice deleted the use-B-on-bearer-token branch February 23, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Always send Authorization: Bearer with the capital B

1 participant