Skip to content

Commit 1df1bec

Browse files
authored
Merge pull request #7299 from kenjis/refactor-header-name
refactor: consistent header name case
2 parents 870ed41 + fa4a048 commit 1df1bec

5 files changed

Lines changed: 10 additions & 11 deletions

File tree

system/HTTP/DownloadResponse.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,8 @@ public function setContentType(string $mime, string $charset = 'UTF-8')
227227
*/
228228
public function noCache(): self
229229
{
230-
$this->removeHeader('Cache-control');
231-
232-
$this->setHeader('Cache-control', ['private', 'no-transform', 'no-store', 'must-revalidate']);
230+
$this->removeHeader('Cache-Control');
231+
$this->setHeader('Cache-Control', ['private', 'no-transform', 'no-store', 'must-revalidate']);
233232

234233
return $this;
235234
}

system/HTTP/ResponseTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ protected function formatBody($body, string $format)
345345
*/
346346
public function noCache()
347347
{
348-
$this->removeHeader('Cache-control');
349-
$this->setHeader('Cache-control', ['no-store', 'max-age=0', 'no-cache']);
348+
$this->removeHeader('Cache-Control');
349+
$this->setHeader('Cache-Control', ['no-store', 'max-age=0', 'no-cache']);
350350

351351
return $this;
352352
}
@@ -399,7 +399,7 @@ public function setCache(array $options = [])
399399
unset($options['last-modified']);
400400
}
401401

402-
$this->setHeader('Cache-control', $options);
402+
$this->setHeader('Cache-Control', $options);
403403

404404
return $this;
405405
}

tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,14 +759,14 @@ public function testSendContinuedWithManyHeaders()
759759
Set-Cookie: PHPSESSID=80pd3hlg38mvjnelpvokp9lad0; path=/
760760
Content-Type: application/xml; charset=utf-8
761761
Transfer-Encoding: chunked\x0d\x0a\x0d\x0a<title>Update success! config</title>";
762-
763762
$request->setOutput($output);
763+
764764
$response = $request->get('answer');
765765

766766
$this->assertSame('<title>Update success! config</title>', $response->getBody());
767767

768768
$responseHeaderKeys = [
769-
'Cache-control',
769+
'Cache-Control',
770770
'Content-Type',
771771
'Server',
772772
'Connection',

tests/system/HTTP/CURLRequestTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,14 +742,14 @@ public function testSendContinuedWithManyHeaders()
742742
Set-Cookie: PHPSESSID=80pd3hlg38mvjnelpvokp9lad0; path=/
743743
Content-Type: application/xml; charset=utf-8
744744
Transfer-Encoding: chunked\x0d\x0a\x0d\x0a<title>Update success! config</title>";
745-
746745
$request->setOutput($output);
746+
747747
$response = $request->get('answer');
748748

749749
$this->assertSame('<title>Update success! config</title>', $response->getBody());
750750

751751
$responseHeaderKeys = [
752-
'Cache-control',
752+
'Cache-Control',
753753
'Content-Type',
754754
'Server',
755755
'Connection',

user_guide_src/source/concepts/http/002.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
$response->setStatusCode(Response::HTTP_OK);
88
$response->setBody($output);
9-
$response->setHeader('Content-type', 'text/html');
9+
$response->setHeader('Content-Type', 'text/html');
1010
$response->noCache();
1111

1212
// Sends the output to the browser

0 commit comments

Comments
 (0)