This post is more than 5 years old
2 Posts
0
3732
March 1st, 2016 17:00
Headers Case Sensitive
So after some investigation I have found that ECS is case sensitive when sending headers when sending via S3 and expects the case to be all lower case. I also went and validated that AWS is not case sensitive. Does anyone know if this will get changed to more closely match AWS?
Example: Both these examples to AWS work...
PUT /blah.pl HTTP/1.1
Date: Tue, 01 Mar 2016 06:32:02 GMT
Authorization: AWS ===============================
Host: blah.s3-us-west-2.amazonaws.com
Content-Length: 1571
X-Amz-Author: me
Content-Type: text/script
User-Agent: HTTP-Tiny/0.054
PUT /blah.pl HTTP/1.1
Date: Tue, 01 Mar 2016 06:32:03 GMT
Authorization: AWS ===============================
Host: blah.s3-us-west-2.amazonaws.com
Content-Length: 1571
x-amz-author: me
Content-Type: text/script
User-Agent: HTTP-Tiny/0.054
Both PUT will receive the data, but the lower case example is the only one that will set the meta
PUT /blah.pl HTTP/1.1
Date: Tue, 01 Mar 2016 06:32:04 GMT
Authorization: AWS ===============================
Host: blah.ecs.somewhere.com
Content-Length: 1571
X-Amz-Author: me
Content-Type: text/script
User-Agent: HTTP-Tiny/0.054
However this does...
PUT /blah.pl HTTP/1.1
Date: Tue, 01 Mar 2016 06:32:01 GMT
Authorization: AWS ===============================
Host: blah.ecs.somewhere.com
Content-Length: 1571
x-amz-author: me
Content-Type: text/script
User-Agent: HTTP-Tiny/0.054
0 events found


chris_arnett
110 Posts
0
March 2nd, 2016 07:00
I did some additional testing in our lab here and it turns out ECS currently does store the metadata name verbatim (case sensitive). This was tested using the AWS CLI against ECS 2.2. Uppercase metadata names are stored and returned as uppercase (if you PUT x-amz-meta-Foo, you will GET x-amz-meta-Foo).
Pondering the HTTP spec a bit, there is no expectation of case, since the headers are supposed to be case-insensitive. So really it is up to the sub-spec (S3) to determine whether case matters. Technically neither implementation is "wrong", but since compatibility trumps, we should probably store the names as lowercase. I will create the bug and bump the priority for the next release.
chris_arnett
110 Posts
0
March 2nd, 2016 07:00
After running a few of my own tests, it appears that, even if you specify capital letters in the metadata name, AWS stores the name in lowercase. So when you HEAD the object afterward, you will see x-amz-meta-auther: me every time. Applications must be aware of this or they will not read the correct values, so it would behoove you to always use lowercase metadata names anyway.
That said, I'll open a bug to accept uppercase metadata names and store them as lowercase (to mimic AWS). However, it will be low priority, so I can't say when it might get pushed into a release.
JasonCwik
281 Posts
0
March 2nd, 2016 07:00
Hi John,
We're looking into this. Make sure you're using x-amz-meta-author and not x-amz-author.
rodenj
2 Posts
0
March 2nd, 2016 08:00
Thanks you very much! And yes I was storing x-amz-meta-author... I just typo while sanitizing the data.