Skip to content

Commit

Permalink
match HTTP2 status code too
Browse files Browse the repository at this point in the history
  • Loading branch information
Athlon1600 committed Dec 31, 2019
1 parent 7e5c5b9 commit dc8266d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class Proxy {

// Proxy script version
const VERSION = '5.1.0';
const VERSION = '5.2.0';

private $dispatcher;

Expand All @@ -35,7 +35,7 @@ private function header_callback($ch, $headers){

// extract status code
// if using proxy - we ignore this header: HTTP/1.1 200 Connection established
if(preg_match('/HTTP\/1.\d+ (\d+)/', $headers, $matches) && stripos($headers, '200 Connection established') === false){
if(preg_match('/HTTP\/[\d.]+\s*(\d+)/', $headers, $matches) && stripos($headers, '200 Connection established') === false){

$this->response->setStatusCode($matches[1]);
$this->status_found = true;
Expand Down

0 comments on commit dc8266d

Please sign in to comment.