amphp / http

HTTP primitives which can be shared by servers and clients.
https://amphp.org/http
MIT License
88 stars 10 forks source link

Expose original header case #11

Closed kelunik closed 4 years ago

kelunik commented 4 years ago

Relates to amphp/http-client#242.

nicolas-grekas commented 4 years ago

I'm seeing this in some code: $request->setHeaders($originRequest->getHeaders());

we might need a setRawHeaders method to allow $request->setRawHeaders($originRequest->getRawHeaders());?

kelunik commented 4 years ago

Not sure how often that will happen. I guess the following is enough for now?

foreach ($originRequest->getRawHeaders() as [$key, $value]) {
    $request->addHeader($key, $value);
}
nicolas-grekas commented 4 years ago

That's what I did, so yes!