magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Magento\Framework\HTTP\Adapter\Curl does not format headers correctly

Open RobKega opened this issue 4 months ago • 4 comments

Preconditions and environment

  • 2.4.7-p3

Steps to reproduce

  • Create a Magento\Framework\HTTP\LaminasClient
  • set headers in key => value pairs, like ['Authorization' => 'Bearer SomeToken']
  • set option CURLOPT_VERBOSE => true (to see the actual headers being sent)
  • do a request
  • see that the Authorization (and other custom headers) is missing

Expected result

Custom headers are added to the request

Actual result

Custom headers are not present in the request

Additional information

the Laminas Curl adapter formats the key => value headers to an array of string headers for curl, the Magento\Framework\HTTP\Adapter\Curl does not do this and that is why it fails

see : laminas-http/src/Client/Adapter/Curl.php line 488

Release note

No response

Triage and priority

  • [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [X] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

RobKega avatar Oct 17 '24 10:10 RobKega