Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mecha committed Jul 26, 2021
2 parents 3831408 + 4718fa0 commit ce50ac1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.3] - 2021-07-26
### Fixed
- Empty response status codes no longer trigger an exception about status code range

## [0.2] - 2021-06-23
### Changed
- Using stable dependency versions
Expand Down
3 changes: 2 additions & 1 deletion src/WpHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public function handle(RequestInterface $request): ResponseInterface

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

$code = (int) wp_remote_retrieve_response_code($responseData);
$code = wp_remote_retrieve_response_code($responseData);
$code = is_numeric($code) ? (int) $code : 400;
$reason = wp_remote_retrieve_response_message($responseData);
$headers = wp_remote_retrieve_headers($responseData);
$headers = is_array($headers) ? $headers : iterator_to_array($headers);
Expand Down

0 comments on commit ce50ac1

Please sign in to comment.