HTTP header names are case-insensitive#406
HTTP header names are case-insensitive#406drzraf wants to merge 4 commits intophp-opencloud:masterfrom
Conversation
…wercased name too so that code can consistently rely on it
| $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.
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.
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.