Skip to content

Commit

Permalink
Merge pull request #2796 from mapogolions/fix/http-message-format
Browse files Browse the repository at this point in the history
Fix HTTP message format
  • Loading branch information
l0gicgate committed Aug 12, 2019
2 parents 88187e7 + f777a1a commit fabf552
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Slim/ResponseEmitter.php
Expand Up @@ -41,8 +41,8 @@ public function emit(ResponseInterface $response): void
->withoutHeader('Content-Type')
->withoutHeader('Content-Length');
}
$this->emitHeaders($response);
$this->emitStatusLine($response);
$this->emitHeaders($response);
}

if (!$isEmpty) {
Expand Down
4 changes: 2 additions & 2 deletions tests/ResponseEmitterTest.php
Expand Up @@ -136,9 +136,9 @@ public function testResponseReplacesPreviouslySetHeaders()
$responseEmitter->emit($response);

$expectedStack = [
['header' => 'HTTP/1.1 200 OK', 'replace' => true, 'status_code' => 200],
['header' => 'X-Foo: baz1', 'replace' => true, 'status_code' => null],
['header' => 'X-Foo: baz2', 'replace' => false, 'status_code' => null],
['header' => 'HTTP/1.1 200 OK', 'replace' => true, 'status_code' => 200],
];

$this->assertSame($expectedStack, HeaderStack::stack());
Expand All @@ -154,9 +154,9 @@ public function testResponseDoesNotReplacePreviouslySetSetCookieHeaders()
$responseEmitter->emit($response);

$expectedStack = [
['header' => 'HTTP/1.1 200 OK', 'replace' => true, 'status_code' => 200],
['header' => 'set-cOOkie: foo=bar', 'replace' => false, 'status_code' => null],
['header' => 'set-cOOkie: bar=baz', 'replace' => false, 'status_code' => null],
['header' => 'HTTP/1.1 200 OK', 'replace' => true, 'status_code' => 200],
];

$this->assertSame($expectedStack, HeaderStack::stack());
Expand Down

0 comments on commit fabf552

Please sign in to comment.