kopia lustrzana https://github.com/gaul/s3proxy
Make CORS handling optional
If corsRules is null, construct the default rules. Also add HEAD method for CORS Co-authored-by: Shannon Noe <shannon.noe@drwholdings.com>pull/361/head
rodzic
48d10653c5
commit
4a6a3f2f4a
|
@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
final class CrossOriginResourceSharing {
|
||||
protected static final Collection<String> SUPPORTED_METHODS =
|
||||
ImmutableList.of("GET", "PUT", "POST");
|
||||
ImmutableList.of("GET", "HEAD", "PUT", "POST");
|
||||
|
||||
private static final String HEADER_VALUE_SEPARATOR = ", ";
|
||||
private static final String ALLOW_ANY_ORIGIN = "*";
|
||||
|
|
|
@ -220,8 +220,14 @@ public class S3ProxyHandler {
|
|||
AuthenticationType authenticationType, final String identity,
|
||||
final String credential, @Nullable String virtualHost,
|
||||
long maxSinglePartObjectSize, long v4MaxNonChunkedRequestSize,
|
||||
boolean ignoreUnknownHeaders, CrossOriginResourceSharing corsRules,
|
||||
boolean ignoreUnknownHeaders,
|
||||
@Nullable CrossOriginResourceSharing corsRules,
|
||||
final String servicePath, int maximumTimeSkew) {
|
||||
if (corsRules != null) {
|
||||
this.corsRules = corsRules;
|
||||
} else {
|
||||
this.corsRules = new CrossOriginResourceSharing();
|
||||
}
|
||||
if (authenticationType != AuthenticationType.NONE) {
|
||||
anonymousIdentity = false;
|
||||
blobStoreLocator = new BlobStoreLocator() {
|
||||
|
@ -252,7 +258,6 @@ public class S3ProxyHandler {
|
|||
this.maxSinglePartObjectSize = maxSinglePartObjectSize;
|
||||
this.v4MaxNonChunkedRequestSize = v4MaxNonChunkedRequestSize;
|
||||
this.ignoreUnknownHeaders = ignoreUnknownHeaders;
|
||||
this.corsRules = corsRules;
|
||||
this.defaultBlobStore = blobStore;
|
||||
xmlOutputFactory.setProperty("javax.xml.stream.isRepairingNamespaces",
|
||||
Boolean.FALSE);
|
||||
|
|
Ładowanie…
Reference in New Issue