Invalid file protocol response body detection
Greg0 opened this issue · comments
Guzzle version(s) affected: 7.5.0
PHP version: 8.1
cURL version: 7.81
Description
Library can't correctly build response by querying local prepared page via FILE protocol.
How to reproduce
I've made simply issue reproduction in compare to plain Curl request
https://gist.github.com/Greg0/57eedb952d1de19a41b9c6f9d40b733f
Possible Solution
Issue location \GuzzleHttp\Handler\CurlFactory::createHeaderFn
When querying standard page via http
protocol, every header line ends with single CRLF and there is always last plain single header line \r\n
, where guzzle detects end of headers and start of body.
When querying by file
protocol, last header line have double CRLF at the end (\r\n\r\n
). So it is trimmed and code thinks there is no body.
https://imgur.com/URUEU7h
Guzzle does not support that protocol. Care should be taken when setting options not supported by Guzzle into curl.