Skip to content

Use case-insensitive lookup for Content-Type header#15

Open
jan-osch wants to merge 1 commit intotj:masterfrom
jan-osch:master
Open

Use case-insensitive lookup for Content-Type header#15
jan-osch wants to merge 1 commit intotj:masterfrom
jan-osch:master

Conversation

@jan-osch
Copy link
Copy Markdown

Parse-curl uses a case-sensitive lookup for headers, I discovered a tiny problem with it.

If a curl command includes data e.g. -d example=true, curl will provide a default 'Content-Type': 'application/x-www-form-urlencoded' header, but only if no Content-Type(case-insensitive) header is provided in the command. Currently, parse-curl will add the default header eagerly, even if a content-type header is provided later in the command.

This PR fixes the module to follow the behavior of curl. I tried to follow the existing style (it was tempting to modernize).

@jan-osch
Copy link
Copy Markdown
Author

jan-osch commented Dec 7, 2020

Any update on that?

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.

1 participant