-
Notifications
You must be signed in to change notification settings - Fork 150
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
HTTP header names are case-insensitive #406
HTTP header names are case-insensitive #406
Conversation
…wercased name too so that code can consistently rely on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need a unit test for this case
$name = substr($header, strlen(static::METADATA_PREFIX)); | ||
$metadata[$name] = $response->getHeader($header)[0]; | ||
if ($name !== strtolower($name)) { | ||
$metadata[strtolower($name)] = $response->getHeader($header)[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also not sure we need this at all. It might break the backward compatibility as swift metadata would have double keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It allows my $container->getMetadata()["temp-url-key"]
code to work indistinctly on both OVH swift 2.33 (and its all-lowercase headers) but also on another provider's Swift 2.25 with mixed-case headers' names.
I'm sorry, I can't enter into such a thing. |
I merged case insensitive comparison. But filling the metadata must be the same for backward compatibility. I can release "uniform" metadata in the next major release, but I'm not planning it in the near future. You might create an interface to check metadata case-insensitive. Like |
I guess a Guzzle update or the swift provider HTTP server or a Swift update (or an intermediary proxy) changed the case of the HTTP headers and...
getMetadata()
started being empty what drove me crazy until I understood it.