Merge pull request #155 from rhansen/content-type-header

Fix regex searching for Content-Type header
This commit is contained in:
Richard Hansen 2020-06-09 15:01:34 -04:00 committed by GitHub
commit 1d78f5fbe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2046,7 +2046,7 @@ sub geturl {
$request .= "Authorization: Basic $auth\n" if $login || $password; $request .= "Authorization: Basic $auth\n" if $login || $password;
$request .= "User-Agent: ${program}/${version}\n"; $request .= "User-Agent: ${program}/${version}\n";
if ($data) { if ($data) {
$request .= "Content-Type: application/x-www-form-urlencoded\n" if !$headers =~ /^Content-Type: /; $request .= "Content-Type: application/x-www-form-urlencoded\n" if $headers !~ /^Content-Type:/mi;
$request .= "Content-Length: " . length($data) . "\n"; $request .= "Content-Length: " . length($data) . "\n";
} }
$request .= "Connection: close\n"; $request .= "Connection: close\n";