Skip to content

fix: don't append default headers already set on the request - #286

Draft
Apeksha9389 wants to merge 3 commits into
conductor-oss:mainfrom
Apeksha9389:fix/duplicate-default-headers
Draft

Apeksha9389 wants to merge 3 commits into
conductor-oss:mainfrom
Apeksha9389:fix/duplicate-default-headers

Conversation

@Apeksha9389

Copy link
Copy Markdown

Fixes conductor-oss/conductor-cli#123

prepareRequest sets the request-specific headers and then appends the defaults from HttpSettings.Headers with Header.Add, so every JSON request carries Accept and Content-Type twice. The token request in token_helper.go has the same pattern. Defaults are now applied only when the request has not already set that header, so request-specific values (e.g. text/plain for secrets) win.

Testing: added http_requester_test.go, which checks that each header appears once and that a request-specific Content-Type is kept. I could not run go test in my environment, so this is a draft until CI passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S9X4Ebdq8FNMfeYAx71CJi

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.

Conductor CLI sends duplicate Accept and Content-Type headers across multiple commands

1 participant