Skip to content

Commit

Permalink
Fix Content-Length for POST when data empty
Browse files Browse the repository at this point in the history
Signed-off-by: Jacques ROUSSEL <[email protected]>
  • Loading branch information
rouja committed Oct 3, 2023
1 parent 76de900 commit d0d8e23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,12 @@ protected function prepareHeaders($body, $uri)
$headers['Content-Length'] = strlen($body);
}
}

Check failure on line 1258 in src/Client.php

View workflow job for this annotation

GitHub Actions / QA Checks (PHPCodeSniffer [8.0, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Expected 1 space after closing brace; newline found
else {
if ($this->getMethod() == 'POST') {

Check failure on line 1260 in src/Client.php

View workflow job for this annotation

GitHub Actions / QA Checks (PHPCodeSniffer [8.0, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Operator == is disallowed, use === instead.
$headers['Content-Length'] = 0;
}
}

Check failure on line 1264 in src/Client.php

View workflow job for this annotation

GitHub Actions / QA Checks (PHPCodeSniffer [8.0, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Unexpected blank line found

// Merge the headers of the request (if any)
// here we need right 'http field' and not lowercase letters
Expand Down

0 comments on commit d0d8e23

Please sign in to comment.