mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
fix(s3): return empty LocationConstraint for us-east-1 buckets (#336)
This commit is contained in:
1 parent
7b28155e26
commit
5ca47a5593
2 files changed
+60
-9
No files matched your search
@@ -1147,16 +1147,17 @@ public class S3Controller {
|
||||
|
||||
private Response handleGetBucketLocation(String bucket) {
|
||||
String region = s3Service.getBucketRegion(bucket);
|
||||
if (region == null) {
|
||||
region = regionResolver.getDefaultRegion();
|
||||
XmlBuilder xml = new XmlBuilder()
|
||||
.raw("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
|
||||
if (region == null || "us-east-1".equals(region)) {
|
||||
xml.start("LocationConstraint", AwsNamespaces.S3)
|
||||
.end("LocationConstraint");
|
||||
} else {
|
||||
xml.start("LocationConstraint", AwsNamespaces.S3)
|
||||
.raw(XmlBuilder.escape(region))
|
||||
.end("LocationConstraint");
|
||||
}
|
||||
String xml = new XmlBuilder()
|
||||
.raw("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
|
||||
.start("LocationConstraint", AwsNamespaces.S3)
|
||||
.raw(XmlBuilder.escape(region))
|
||||
.end("LocationConstraint")
|
||||
.build();
|
||||
return Response.ok(xml).type(MediaType.APPLICATION_XML).build();
|
||||
return Response.ok(xml.build()).type(MediaType.APPLICATION_XML).build();
|
||||
}
|
||||
|
||||
// --- Bucket Tagging ---
|
||||
|
||||
Reference in new issue
Block a user