From 6be49c67422e990233c4dcdaf61405e539b9dc93 Mon Sep 17 00:00:00 2001 From: tlanyan Date: Sat, 9 Jan 2021 14:35:45 +0800 Subject: [PATCH] feat: catch any response --- index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.php b/index.php index 4e04e71..f332798 100644 --- a/index.php +++ b/index.php @@ -131,6 +131,8 @@ function fetch(Psr\Http\Message\ServerRequestInterface $req) { $url = substr($url, 1); $client = new React\Http\Browser($loop); + // catch any response + $client = $client->withRejectErrorResponse(false); // see https://github.com/reactphp/http#streaming-response return $client->requestStreaming($req->getMethod(), $url)->then(function (Psr\Http\Message\ResponseInterface $response) {