btcpayserver / btcpayserver-php-client

PHP implementation for the BTCPayServer cryptographically secure RESTful API
MIT License
29 stars 33 forks source link

Make sure its possible to get response code behind http/2 proxy #11

Closed sven-codeculture closed 5 years ago

sven-codeculture commented 5 years ago

My traefic proxy returns "HTTP/2 404 "

woutersamaey commented 5 years ago

I just discovered and fixed the same thing, but you beat me to it. Do prefer my regex as it allows for any number of digits and periods.

preg_match('/^HTTP\/([\d\.]+)\s(\d+)/', $lines[$i], $statusLine);

In my case I had an Nginx HTTP2 proxy. The line to match is HTTP/2 404

sven-codeculture commented 5 years ago

Yea, would also be possible. But i don't like your's completely since it would also allow something like HTTP/2....2 404 In the end i do not mind any regexp as long as the issue with the http2 proxy is fixed.

NicolasDorier commented 5 years ago

sorry, I did not got notifications of this repo. Waiting @klokit-co to test this PR and merging it.

NicolasDorier commented 5 years ago

He told me on mattermost that this fix his issue.