S3/ASF parser: fix parsing header list
shape type with multivalue headers
#13022
+170
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
We got a report with #12999 that sending a
GetObjectAttributes
request would fail depending on the order of the fields being passed.While debugging and printing out low level HTTP request on the Java side, I realized that Java was sending the request with multiple headers for the same key, like some others SDK (Go in particular)
When receiving headers that way, our web server will return them as a list of values, accessible via
Headers.getlist()
.Because the parser was calling
Headers.get()
, it would only get the first value, and in the user sample above, would not even return the second requested attribute.This PR adapts the parser to use
getlist
in the header shape type islist
, and keep the old automatic splitting on,
that is still required.Changes
headers
override! This was so much easier to write a test for it!!!)requests
concatenates multivalue headers by default buturllib3
does not-Testing
If you remove the parser fix, the tests now fail.
I also validated that the user-provided sample in the linked issue now works 👍