Skip to content

Commit

Permalink
Add a default bad response in case of no response given
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGigi committed Nov 4, 2022
1 parent 1cdcb80 commit 74b146d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This projec
to [Semantic Versioning] (http://semver.org/). For change log format,
use [Keep a Changelog] (http://keepachangelog.com/).

## [1.0.0-beta5] - 2022-11-04

### Changed

- Add a default bad response in case of no response given

## [1.0.0-beta4] - 2022-08-25

### Added
Expand Down
19 changes: 18 additions & 1 deletion src/Entities/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,30 @@ public function __construct(
protected DateTimeImmutable $startedDateTime,
protected float $time,
protected Request $request,
protected Response $response,
protected ?Response $response,
protected array $cache,
protected Timings $timings,
protected ?string $serverIPAddress,
protected ?string $connection = null,
protected ?string $comment = null,
) {
// Set bad response
$this->response ??= new Response(
status: 0,
statusText: '',
httpVersion: '',
cookies: [],
headers: [],
content: new Content(
size: 0,
compression: null,
mimeType: 'x-unknown',
text: '',
),
redirectURL: '',
headersSize: -1,
bodySize: -1,
);
}

/**
Expand Down

0 comments on commit 74b146d

Please sign in to comment.