Description
Description
The following code:
PHP behavior for parsing headers keys and header values are not consistent across PHP supported hTTP APIs.
For example: curl APIs doesnt trim leading spaces from headers key and value . " Header2 : VALUE2 " Here key ad value will have spaces in it for CURL APIs.
However for Soap APIs remove leading/trailing spaces before reading header key and value .
IMO , There should be some consistency around PHP HTTP APIs for parsing headers key and values.
header key and values should be propagated as it is provided by user by tokenizing based on ": " or ":" because few people has tendency to write space after each punctuation , so everything after ": " or ":" should be considered as value and key should be propagated as it is .
PHP Version
PHP 8.4
Operating System
Ubuntu24