-
Notifications
You must be signed in to change notification settings - Fork 850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are response headers returned by HTTP client expected to be flat or not? #992
Comments
Merged
Hello @ostrolucky, as far as we can tell it is always flat. This alerted us to a bug in our telemetry reporting. Thank you for pointing it out! |
Alright. And what's the expectation when server returns multiple values for same header name? Eg.
|
The current behavior seems to be that it sets the value equal to the last header specified. |
Alright thx, I'll make my adapter to behave same way |
ostrolucky
added a commit
to psr18-adapter/stripe-php
that referenced
this issue
Aug 15, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm building PSR-18 adapter for stripe-php and it's unclear if Stripe\HttpClient\ClientInterface::request method should return flat list of headers, or PSR-7 style headers where headers with multiple values are grouped under same key as another array value. So basically, should list of headers be
array<string, string>
, orarray<string, list<string>>
?My confusion lies because your test cases assert for flat values
stripe-php/tests/Stripe/HttpClient/CurlClientTest.php
Line 339 in fd57205
stripe-php/lib/ApiRequestor.php
Line 382 in fd57205
And as far as I can see, the code given is the only time your library happens to read response headers.
The text was updated successfully, but these errors were encountered: