Amazon S3: Objects Named Slash

Give ‘em a crazy top hat, a guitar, and name these objects slash!  Actually, I’m going to see if I can just name an object “/” (forward slash).  If that’s possible then it will act as a default document (e.g. root key) for hosting purposes.

Nope, duh, I just looked at the documentation again and forgot a “GET /” is interpreted as “List Objects”.  Other than that one teensy detail, it doesn’t appear the forward slash plays any particular role.  So … yeah … crap.

If you do try to name an object with just a slash, you get this friendly response:

400 Bad Request
x-amz-request-id: BBD9383035200D7B
x-amz-id-2: ktAotrqe4iQIMV5oARSThSEDZVOn3RRxIp4iT4RIX1BFSgyx5XcStJh5M0zdoi+0
Content-Type: application/xml
Transfer-Encoding: chunked
Date: Fri, 12 Sep 2008 07:17:57 GMT
nnCoection: close
Server: AmazonS3

<?xml version=”1.0″ encoding=”UTF-8″?>
<Error><Code>MalformedXML</Code><Message>The XML you provided was not well-formed or did not validate against our published schema</Message><RequestId>BBD9383035200D7B</RequestId><HostId>ktAotrqe4iQIMV5oARSThSEDZVOn3RRxIp4iT4RIX1BFSgyx5XcStJh5M0zdoi+0</HostId></Error>

Which is interesting since I’m using the REST API.  My guess is the REST commands are translated into SOAP and that is first validated.  Fun.

Leave a Reply