Skip to content
Prev Previous commit
Next Next commit
Record unless replayed
  • Loading branch information
GaryPEGEOT committed Mar 25, 2019
commit 5cd124324ef00536687566ccf467064059c543ab
2 changes: 1 addition & 1 deletion src/RecordPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
$name = $this->namingStrategy->name($request);

return $next($request)->then(function (ResponseInterface $response) use ($name) {
if ($response->getStatusCode() < 300 && !$response->hasHeader(ReplayPlugin::HEADER_NAME)) {
if (!$response->hasHeader(ReplayPlugin::HEADER_NAME)) {
$this->recorder->record($name, $response);
$response = $response->withAddedHeader(static::HEADER_NAME, $name);
}
Expand Down