Explicitly handle get location

pull/27/head
Andrew Gaul 2014-12-29 16:20:56 -08:00
rodzic d33324797a
commit 807f6ef47c
1 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -277,6 +277,10 @@ final class S3ProxyHandler extends AbstractHandler {
handleContainerOrBlobAcl(response, path[1]);
baseRequest.setHandled(true);
return;
} else if ("".equals(request.getParameter("location"))) {
handleContainerLocation(response, path[1]);
baseRequest.setHandled(true);
return;
}
handleBlobList(request, response, path[1]);
baseRequest.setHandled(true);
@ -400,6 +404,16 @@ final class S3ProxyHandler extends AbstractHandler {
}
}
private void handleContainerLocation(HttpServletResponse response,
String containerName) throws IOException {
try (Writer writer = response.getWriter()) {
// TODO: using us-standard semantics but could emit actual location
writer.write(XML_PROLOG +
"<LocationConstraint " + AWS_XMLNS + "/>");
writer.flush();
}
}
private void handleContainerExists(HttpServletResponse response,
String containerName) throws IOException {
if (!blobStore.containerExists(containerName)) {