laminas / laminas-http

Provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests
https://docs.laminas.dev/laminas-http/
BSD 3-Clause "New" or "Revised" License
36 stars 27 forks source link

Allows `require-trusted-types-for` CSP directive #67

Closed blat closed 2 years ago

blat commented 2 years ago
Q A
Bugfix yes
BC Break no

Description

When headers contain require-trusted-types-for CSP directive, Headers::toArray ends with a PHP Fatal Error.

To reproduce:

use Laminas\Http\Client;
$client = new Client('http://news.google.com/news?ned=us&topic=t&output=atom');
$client->send()->getHeaders()->toArray();

Current result:

PHP Fatal error: Uncaught Error: [] operator not supported for strings in vendor/laminas/laminas-http/src/Headers.php:456
Ocramius commented 2 years ago

@weierophinney are you able to push the composer.json addition to this?

weierophinney commented 2 years ago

@weierophinney are you able to push the composer.json addition to this?

I'm actually reviewing from my phone while camping... So, no. 😁

Ocramius commented 2 years ago

Cool, I'll do it then :D

Ocramius commented 2 years ago

Thanks @blat!

Ocramius commented 2 years ago

Argh, I merged to the wrong branch. Fixing.