Skip to content

Commit

Permalink
Always call ->send() after apply header Location
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jan 18, 2017
1 parent f67deab commit 3ad900f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/Listener/ForceHttpsSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
allow($mvcEvent)->toReceive('getResponse')->andReturn($response);
allow($response)->toReceive('setStatusCode')->with(302)->andReturn($response);
allow($response)->toReceive('getHeaders', 'addHeaderLine')->with('Location', 'https://example.com/about');
allow($response)->toReceive('send');

expect($mvcEvent)->toReceive('getResponse');

Expand Down
1 change: 1 addition & 0 deletions src/Listener/ForceHttps.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ public function forceHttpsScheme(MvcEvent $e)
$response->setStatusCode(302);
$response->getHeaders()
->addHeaderLine('Location', $httpsRequestUri);
$response->send();
}
}

0 comments on commit 3ad900f

Please sign in to comment.