File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
55and 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
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments