Skip to content

fix: join multiple beta headers with commas per API specfix: join multiple beta headers with commas per API spec#287

Open
aydinomer00 wants to merge 1 commit intoanthropics:mainfrom
aydinomer00:fix/266-comma-separated-beta-headers
Open

fix: join multiple beta headers with commas per API specfix: join multiple beta headers with commas per API spec#287
aydinomer00 wants to merge 1 commit intoanthropics:mainfrom
aydinomer00:fix/266-comma-separated-beta-headers

Conversation

@aydinomer00
Copy link
Copy Markdown

Fixes #266. When multiple beta features are requested, Go's Header.Add() creates separate HTTP header lines (Anthropic-Beta: value1, then Anthropic-Beta: value2). The Anthropic API docs specify that multiple beta features should be comma-separated in a single header (Anthropic-Beta: value1,value2).

Replaced the for-loop + individual WithHeaderAdd pattern with strings.Join to produce a single comma-separated header value across all beta service files (8 files, 17 occurrences).

Added a middleware-based unit test to verify comma-separated format.

Fixes anthropics#266. When multiple beta features are requested, Go's Header.Add()
creates separate HTTP header lines (Anthropic-Beta: value1, then
Anthropic-Beta: value2). The Anthropic API docs specify that multiple
beta features should be comma-separated in a single header
(Anthropic-Beta: value1,value2).

Replaced the for-loop + individual WithHeaderAdd pattern with
strings.Join to produce a single comma-separated header value across
all beta service files (8 files, 17 occurrences).

Added a middleware-based unit test to verify comma-separated format.
@aydinomer00 aydinomer00 requested a review from a team as a code owner March 7, 2026 07:03
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.

Multiple Beta headers not added according to API specification

1 participant