Skip to content

Commit

Permalink
Set field 'response' to value 'Empty Response' instead of 'HTML Respo…
Browse files Browse the repository at this point in the history
…nse' when content/body of Response object is empty (#1242)

Co-authored-by: Benjamin DENIZART <benjamin@osiris.mc>
  • Loading branch information
bdenizar and Benjamin DENIZART authored Aug 8, 2022
1 parent 3f4e622 commit 0368468
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Watchers/ClientRequestWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ protected function response(Response $response)
return 'Redirected to '.$response->header('Location');
}

if (empty($content)) {
return 'Empty Response';
}

return 'HTML Response';
}

Expand Down
4 changes: 4 additions & 0 deletions src/Watchers/RequestWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ protected function response(Response $response)
];
}

if (is_string($content) && empty($content)) {
return 'Empty Response';
}

return 'HTML Response';
}

Expand Down

0 comments on commit 0368468

Please sign in to comment.