aws/aws-sdk-js-apis — pull request #1 by digihaven (2014-03-16 20:49:28+00:00)
Title: Fixed issue with firefox cached body causing s3.headObject to error

If Firefox does a s3.headObject on a cached object, it will return the body of that file. The aws-sdk-2.0.0-rc11 uses the wrong assumption that its an S3 XML response and will parse it as XML.

Example:
If the file has non xml such as a jpg file, aws-sdk-2.0.0-rc11 will throw errors trying to read it.

Test code:

It his test code Body: 'hello' is not valid XML form S3
````````````````````````

````````````````````````

Firefox before Fix:
````````````````````````````````````
userAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0

Write example data - putObject.ETag: "5d41402abc4b2a76b9719d911017c592"

Test if it works not cached - headObject.ETag: "5d41402abc4b2a76b9719d911017c592"

So we have it cached - getObject.ETag: "5d41402abc4b2a76b9719d911017c592"

Test if it works cached - headObject.ETag: error@https://sdk.amazonaws.com/js/aws-sdk-2.0.0-rc11.js:11974 strictFail@https://sdk.amazonaws.com/js/aws-sdk-2.0.0-rc11.js:11994 write@https://sdk.amazonaws.com/js/aws-sdk-2.0.0-rc11.js:12244 [73]
````````````````````````````````````

Firefox after Fix:
````````````````````````````````````
userAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0

Write example data - putObject.ETag: "5d41402abc4b2a76b9719d911017c592"

Test if it works not cached - headObject.ETag: "5d41402abc4b2a76b9719d911017c592"

So we have it cached - getObject.ETag: "5d41402abc4b2a76b9719d911017c592"

Test if it works cached - headObject.ETag: "5d41402abc4b2a76b9719d911017c592"
````````````````````````````````````

I added "Body": {"type": "binary","streaming": true }, and "payload": "Body" to fix the issue.

Concerns:

1) I'm not sure why the all of the files say they where updated 3 days ago. Are these files from a conversion?
2) Body will only be returned by browsers such as Firefox.