Closed bwoebi closed 1 week ago
amphp/http-client expects 2, but PSRAdapter accepts a 2.0 too.
2
2.0
Invalid HTTP protocol version: 2.0 at vendor/amphp/http-client/src/Request.php:126 #0 vendor/amphp/http-client-psr7/src/PsrAdapter.php(31): Amp\\Http\\Client\\Request->setProtocolVersions() #1 vendor/amphp/http-client-guzzle-adapter/src/GuzzleHandlerAdapter.php(85): Amp\\Http\\Client\\Psr7\\PsrAdapter->fromPsrRequest()
A trivial workaround would be
$protocolVersion = $source->getProtocolVersion(); $target->setProtocolVersions([$protocolVersion == "2.0" ? "2" : $protocolVersion]);
in https://github.com/amphp/http-client-psr7/blob/6c7589a22f06772794ad38114c980bce8d85b14e/src/PsrAdapter.php#L31
I think this is the right place to change it and not make amphp/http-client support it though.
@trowski The 394f2c59e31eaf16f9e64b1317324e26b7f8e4e4 commit looks good to me - can we merge it?
amphp/http-client expects
2
, but PSRAdapter accepts a2.0
too.A trivial workaround would be
in https://github.com/amphp/http-client-psr7/blob/6c7589a22f06772794ad38114c980bce8d85b14e/src/PsrAdapter.php#L31
I think this is the right place to change it and not make amphp/http-client support it though.