Description
This doesn't work 1.7.2
CDNApi.update(CONTAINER_PUBLISH, staticWebsiteIndexPage("index.html"));
Request
- >> POST https://cdn5.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/jclouds-example-publish-1 HTTP/1.1
- >> Accept: application/json
- >> X-Container-Meta-Web-Index: index.html
- >> X-Auth-Token: 0a5d97dc4b8c45ea973fa1deb8135b1b
Response
- << HTTP/1.1 202 Accepted - << X-Cdn-Uri: http://1ec5d81c38dbe7cb4100-6c12dba54c1c3816f22180e043987058.r88.cf5.rackcdn.com - << X-Cdn-Ssl-Uri: https://2fabc5b56d2b5e29a072-6c12dba54c1c3816f22180e043987058.ssl.cf5.rackcdn.com - << Date: Wed, 23 Apr 2014 22:31:43 GMT - << X-Cdn-Ios-Uri: http://164254fd97fd74babb9b-6c12dba54c1c3816f22180e043987058.iosr.cf5.rackcdn.com - << X-Trans-Id: tx905b7653ec784233bfd56-0053583f4fiad3 - << X-Cdn-Streaming-Uri: http://7433525bb40a8cbbe429-6c12dba54c1c3816f22180e043987058.r88.stream.cf5.rackcdn.com - << Content-Type: text/html; charset=UTF-8 - << Content-Length: 76 - << "<html><h1>Accepted</h1><p>The request is accepted for processing.</p></html>"
CloudFilesApi.containerApiInRegion(REGION).head(CONTAINER_PUBLISH);
Request
- >> HEAD https://storage101.iad3.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/jclouds-example-publish-1 HTTP/1.1
- >> Accept: application/json
- >> X-Auth-Token: 0a5d97dc4b8c45ea973fa1deb8135b1b
Response
- << HTTP/1.1 204 No Content
- << X-Container-Object-Count: 1
- << Date: Wed, 23 Apr 2014 22:31:43 GMT
- << X-Container-Bytes-Used: 17
- << X-Trans-Id: txe01d5e5f5977402f94dfd-0053583f4fiad3
- << X-Timestamp: 1398283489.41100
- << Accept-Ranges: bytes
Going to http://1ec5d81c38dbe7cb4100-6c12dba54c1c3816f22180e043987058.r88.cf5.rackcdn.com doesn't work because index.html hasn't been set as the default index page. But the file was uploaded to http://1ec5d81c38dbe7cb4100-6c12dba54c1c3816f22180e043987058.r88.cf5.rackcdn.com/index.html
This works 1.7.1
CloudFilesClient.setCDNStaticWebsiteIndex(container, "index.html");
Request
- >> POST https://storage101.iad3.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/_site_bug HTTP/1.1
- >> X-Container-Meta-Web-Index: index.html
- >> X-Auth-Token: 0a5d97dc4b8c45ea973fa1deb8135b1b
Response
- << HTTP/1.1 204 No Content - << Date: Wed, 23 Apr 2014 22:38:21 GMT - << X-Trans-Id: txa0f7021d15c64a718c03c-00535840ddiad3
CloudFilesClient.getCDNMetadata(container);
Request
- >> HEAD https://cdn5.clouddrive.com/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/_site_bug HTTP/1.1
- >> X-Auth-Token: 0a5d97dc4b8c45ea973fa1deb8135b1b
Response
- << HTTP/1.1 204 No Content - << X-Cdn-Uri: http://029a2ed6606567092f9d-a6e2f46637e8e4f26e0e92643f10f077.r43.cf5.rackcdn.com - << X-Cdn-Ssl-Uri: https://d9d20e2d884865536377-a6e2f46637e8e4f26e0e92643f10f077.ssl.cf5.rackcdn.com - << Date: Wed, 23 Apr 2014 22:38:21 GMT - << X-Ttl: 259200 - << X-Trans-Id: tx32899633a9c0406484e4c-00535840ddiad3 - << X-Cdn-Ios-Uri: http://5b399cf751cb1ceb372b-a6e2f46637e8e4f26e0e92643f10f077.iosr.cf5.rackcdn.com - << X-Cdn-Enabled: True - << X-Cdn-Streaming-Uri: http://30ba327e4cebc81cfdc3-a6e2f46637e8e4f26e0e92643f10f077.r43.stream.cf5.rackcdn.com - << X-Log-Retention: False
Going to http://029a2ed6606567092f9d-a6e2f46637e8e4f26e0e92643f10f077.r43.cf5.rackcdn.com works because index.html has been set as the default index page.
Note the difference in endpoint URLs and the lack of CDN headers in the HEAD call in 1.7.2. I suspect the problem might be the lack of the @CDNManagement annotation in CDNApi? Just a guess.
Whatever the fix, we're going to need tests for it in CloudFilesCDNApiLiveTest and CloudFilesCDNApiMockTest.