gaul / s3proxy

Access other storage backends via the S3 API
Apache License 2.0
1.74k stars 223 forks source link

Options Method not Allowed? #567

Closed thaleshorta closed 7 months ago

thaleshorta commented 11 months ago

Hi,

I'm facing a issue when trying to configure s3proxy and the reason is Options methos is not allowed even thou I include in ALLOWED_METHODS.

The issue is the same here https://github.com/gaul/s3proxy/issues/492 but patching the latest version is not working as well.

Thanks for any help.

gaul commented 11 months ago

I don't know anything about this. What does OPTIONS do? https://github.com/Switch-TV/s3proxy/commit/9786ab0bcfd82d6895c7e620cdae8cb1fba2ef29 looks like a plausible fix but you need to explain why this is needed.

thaleshorta commented 11 months ago

Hi Gaul, thanks for the answer.

Our application sends with Options to force the preflight checks on CORS (for security) but, as mentioned by @mmezei this changes the Singature calculation.

Indeed the fix from @mmezei looks plausible, but when I recompile i got this erros:

[s3proxy] E 10-22 14:20:59.800 main org.gaul.s3proxy.Main:279 |::] Exception in thread "main" [s3proxy] E 10-22 14:20:59.892 main org.gaul.s3proxy.Main:279 |::] java.lang.NumberFormatException: For input string: "" [s3proxy] E 10-22 14:20:59.893 main org.gaul.s3proxy.Main:279 |::] at java.base/java.lang.NumberFormatException.forInputString(Unknown Source) [s3proxy] E 10-22 14:20:59.893 main org.gaul.s3proxy.Main:279 |::] at java.base/java.lang.Long.parseLong(Unknown Source) [s3proxy] E 10-22 14:20:59.893 main org.gaul.s3proxy.Main:279 |::] at java.base/java.lang.Long.parseLong(Unknown Source) [s3proxy] E 10-22 14:20:59.893 main org.gaul.s3proxy.Main:279 |::] at org.gaul.s3proxy.S3Proxy$Builder.fromProperties(S3Proxy.java:247) [s3proxy] E 10-22 14:20:59.894 main org.gaul.s3proxy.Main:279 |::] at org.gaul.s3proxy.Main.main(Main.java:158)

gaul commented 11 months ago

This looks like some malformed configuration, see line 247:

            String v4MaxNonChunkedRequestSize = properties.getProperty(
                    S3ProxyConstants.PROPERTY_V4_MAX_NON_CHUNKED_REQUEST_SIZE);
            if (v4MaxNonChunkedRequestSize != null) {
                builder.v4MaxNonChunkedRequestSize(Long.parseLong(
                        v4MaxNonChunkedRequestSize));
            }
gaul commented 7 months ago

6bb02501036ef290bd510491115c63e26757ed43 may address this. Please reopen if symptoms persist.