Skip to content

Commit 69c0875

Browse files
committed
send method bugfix
1 parent f725cdf commit 69c0875

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- `Fixed` for any bug fixes.
1313
- `Security` in case of vulnerabilities
1414

15+
## [1.1.1] - 2020.11.23
16+
17+
### Fixed
18+
19+
- Fixed bug in `send` method where `$_SERVER` may not be set.
20+
1521
## [1.1.0] - 2020.10.20
1622

1723
### Added

src/Response.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,15 @@ public function send(): void
258258

259259
// -------------------- Status code --------------------
260260

261-
$protocol = $_SERVER['SERVER_PROTOCOL'];
261+
if (isset($_SERVER['SERVER_PROTOCOL'])) {
262+
263+
$protocol = $_SERVER['SERVER_PROTOCOL'];
264+
265+
} else {
266+
267+
$protocol = 'HTTP/1.1';
268+
269+
}
262270

263271
$status = $this->getStatusCode();
264272

0 commit comments

Comments
 (0)