Skip to content

Commit ce50ac1

Browse files
committed
Merge branch 'develop'
2 parents 3831408 + 4718fa0 commit ce50ac1

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [0.3] - 2021-07-26
8+
### Fixed
9+
- Empty response status codes no longer trigger an exception about status code range
10+
711
## [0.2] - 2021-06-23
812
### Changed
913
- Using stable dependency versions

src/WpHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ public function handle(RequestInterface $request): ResponseInterface
6262

6363
$responseData = wp_remote_request($uri, $args);
6464

65-
$code = (int) wp_remote_retrieve_response_code($responseData);
65+
$code = wp_remote_retrieve_response_code($responseData);
66+
$code = is_numeric($code) ? (int) $code : 400;
6667
$reason = wp_remote_retrieve_response_message($responseData);
6768
$headers = wp_remote_retrieve_headers($responseData);
6869
$headers = is_array($headers) ? $headers : iterator_to_array($headers);

0 commit comments

Comments
 (0)