Skip to content

Commit

Permalink
Merge pull request #7 from fffguo/master
Browse files Browse the repository at this point in the history
fix Content-Type bug
  • Loading branch information
zvakanaka authored Jul 30, 2022
2 parents d36989f + c6b897e commit 9a20e3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function curlString(
}

function getHeader(options, headerKeyName) {
return options.headers[headerKeyName];
// return header that matches case, but if not found fall back to header that does not match case
return options.headers[headerKeyName] || options.headers[Object.keys(options.headers).find(key => key.toLowerCase() === headerKeyName.toLowerCase())]
}

function hasHeader(options, headerKeyName) {
Expand Down

0 comments on commit 9a20e3c

Please sign in to comment.