tj / parse-curl.js

Parse curl commands, returning an object representing the request.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple Content-Type headers

hatimn02 opened this issue · comments

If curl snippet contains Content-Type in lower case such as content-type then it creates two content-type headers.

Logic to find content-type header should be incasesensitive.

curl --request POST \
  --url http://www.httpbin.org/post \
  --header 'cache-control: no-cache' \
  --header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  --header 'postman-token: 81163614-974d-2fc5-4251-d9f6544f9d2c' \
  --form hello=world \
  --form hello1=world1