Permalink
Browse files

Do not emit response if headers were already sent.

  • Loading branch information...
1 parent 4bac0a7 commit 23afc71a8e8920ca91ca19efa15aadb038ba8ff5 @cdujeu cdujeu committed May 23, 2016
@@ -79,6 +79,9 @@ public static function handleRequest(ServerRequestInterface $request, ResponseIn
$response = Server::callNextMiddleWare($request, $response, $next);
+ if(headers_sent()){
+ return;
+ }
if($response !== false && $response->getBody() && $response->getBody() instanceof SerializableResponseStream){
// For the moment, use XML by default
if($request->hasHeader("Accept") && $request->getHeader("Accept")[0] == "application/json"){
Oops, something went wrong.

0 comments on commit 23afc71

Please sign in to comment.