S3.getObject with VersionId fails in Chrome.
A getObject request against a version enabled S3 bucket with a version ID specified fails in the CORS OPTIONS request in Chrome 40. If a version id is specified S3 returns 400 Bad Request with the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>InvalidArgument</Code>
<Message>This operation does not accept a version-id.</Message>
<ArgumentName>versionId</ArgumentName>
<ArgumentValue>fSm2f.PQjS8vbbNrQWL1_8_fQTUWlDvh</ArgumentValue>
<RequestId>FC057A0AA1C256AF</RequestId>
<HostId>
7OeA0vIjXecL1TGKQO+h87ozwI3Jh3uwCW1QxlxRmamxsN50t58YzztknnqGw1DQ
</HostId>
</Error>
Because of the returned status code, Chrome never issues the GET request. Interestingly, Safari 7 also makes the OPTIONS request and gets back 400, but seems to ignore the OPTIONS response status code and proceeds with the GET request.
If no version id is specified, the OPTIONS request returns 200 and the GET request succeeds in both browsers.
This issue seems very similar to this unresolved stackoverflow question from a year ago: http://stackoverflow.com/questions/22186347/aws-s3-cors-options-preflight-throwing-400-bad-request-during-delete-w-versio
Complete OPTIONS request and response from Chrome (with some bucket specific info redacted):
OPTIONS /xxx/xxx/xxx.xxx?versionId=fSm2f.PQjS8vbbNrQWL1_8_fQTUWlDvh HTTP/1.1
Host: xxxxx.s3.amazonaws.com
Connection: keep-alive
Access-Control-Request-Method: GET
Origin: http://localhost/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36
Access-Control-Request-Headers: x-amz-user-agent, x-amz-security-token, x-amz-date, authorization
Accept: */*
DNT: 1
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
HTTP/1.1 400 Bad Request
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: HEAD, GET, PUT, POST, DELETE
Access-Control-Allow-Headers: x-amz-user-agent, x-amz-security-token, x-amz-date, authorization
Access-Control-Expose-Headers: Etag, x-amz-version-id
Access-Control-Max-Age: 3000
Vary: Origin, Access-Control-Request-Headers, Access-Control-Request-Method
x-amz-request-id: 6EE8030ACAE601E6
x-amz-id-2: ZMU/VQ6S09+SbhwqY3igiJdMnTlc7vrwCtDAi7kFMCvoFirWPb+Ju0aQI07/oFGx
Content-Type: application/xml
Transfer-Encoding: chunked
Date: Fri, 20 Feb 2015 00:04:07 GMT
Connection: close
Server: AmazonS3
@noah-freitas I am able to confirm this behavior. This seems like a problem with Amazon S3 and not an SDK issue since the SDK does conform to the S3 wire protocol spec.
I would recommend opening an issue on the Amazon S3 Forums. I will also try and follow up with the S3 team on this.
@noah-freitas I'm closing this out since it is not an SDK issue and needs to be fixed upstream by the Amazon S3 team.
Feel free to reopen this issue or open another issue if you have other questions.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.