Skip to content

Commit 0420f09

Browse files
committed
:octocat:
1 parent 722d0e4 commit 0420f09

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/CurlClient.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ public function request(string $uri, string $method = null, array $query = null,
133133
elseif($headers['Content-type'] === 'application/json'){
134134
$body = json_encode($body);
135135
}
136+
else{
137+
$body = null; // @todo
138+
}
136139

137140
}
138141

src/Psr7/message_helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function normalize_request_headers(array $headers):array{
4747
}
4848
}
4949

50-
$key = ucfirst(strtolower(trim($key)));
50+
$key = strtolower(trim($key));
5151

5252
$normalized_headers[$key] = trim($val);
5353
}

tests/CurlClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function testRequest(string $method, array $extra_headers){
100100

101101
if(in_array($method, ['patch', 'post', 'put'])){
102102

103-
if(isset($extra_headers['Content-type']) && $extra_headers['Content-type'] === 'application/json'){
103+
if(isset($extra_headers['content-type']) && $extra_headers['content-type'] === 'application/json'){
104104
$this->assertSame('wtf', $json->json->huh);
105105
}
106106
else{

tests/Psr7/MessageHelpersTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class MessageHelpersTest extends TestCase{
1919

2020
public function headerDataProvider():array {
2121
return [
22-
'content-Type' => [['content-Type' => 'application/x-www-form-urlencoded'], ['Content-type' => 'application/x-www-form-urlencoded']],
23-
'lowercasekey' => [['lowercasekey' => 'lowercasevalue'], ['Lowercasekey' => 'lowercasevalue']],
24-
'UPPERCASEKEY' => [['UPPERCASEKEY' => 'UPPERCASEVALUE'], ['Uppercasekey' => 'UPPERCASEVALUE']],
25-
'mIxEdCaSeKey' => [['mIxEdCaSeKey' => 'MiXeDcAsEvAlUe'], ['Mixedcasekey' => 'MiXeDcAsEvAlUe']],
22+
'content-Type' => [['Content-Type' => 'application/x-www-form-urlencoded'], ['content-type' => 'application/x-www-form-urlencoded']],
23+
'lowercasekey' => [['lowercasekey' => 'lowercasevalue'], ['lowercasekey' => 'lowercasevalue']],
24+
'UPPERCASEKEY' => [['UPPERCASEKEY' => 'UPPERCASEVALUE'], ['uppercasekey' => 'UPPERCASEVALUE']],
25+
'mIxEdCaSeKey' => [['mIxEdCaSeKey' => 'MiXeDcAsEvAlUe'], ['mixedcasekey' => 'MiXeDcAsEvAlUe']],
2626
'31i71casekey' => [['31i71casekey' => '31i71casevalue'], ['31i71casekey' => '31i71casevalue']],
27-
'numericvalue' => [[1 => 'numericvalue:1'], ['Numericvalue' => '1']],
27+
'numericvalue' => [[1 => 'numericvalue:1'], ['numericvalue' => '1']],
2828
'invalid: 2' => [[2 => 2], []],
2929
'invalid: what' => [['what'], []],
3030
];

0 commit comments

Comments
 (0)