Skip to content

Fix JSON Content-Type being dropped when single header present#1866

Open
cmw-creator wants to merge 1 commit into
httpie:masterfrom
cmw-creator:fix/json-content-type-header
Open

Fix JSON Content-Type being dropped when single header present#1866
cmw-creator wants to merge 1 commit into
httpie:masterfrom
cmw-creator:fix/json-content-type-header

Conversation

@cmw-creator
Copy link
Copy Markdown

Problem

When running https post pie.dev/post -v 'header1: xyz' x=1, the Content-Type header is missing from the request. With two or more custom headers, Content-Type is correctly set to application/json.

Fix

Preserve the Content-Type header set by make_default_headers when merging user-supplied headers, so it isn't lost when processing a single custom header.

Closes #1834

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.

JSON content type not being set when a single header is present

1 participant