s3proxy
s3proxy copied to clipboard
Return a more coherent error if Transfer-Encoding: chunked is set
AWS S3 v2 signature method does not allow for chunked uploads (setting Transfer-Encoding: chunked). I discovered (through the virtue of a buggy library), that submitting a chunked request to S3Proxy results in:
W 05-05 17:27:54.408 S3Proxy-17 o.e.jetty.http.HttpParser:1355 |::] badMessage: java.lang.NumberFormatException: !hex 35 for HttpChannelOverHttp@6245f4b9{r=4,c=false,a=DISPATCHED,uri=/timur-test/AUTH_test/test/-bash_logout}
W 05-05 17:27:54.411 S3Proxy-17 o.e.jetty.server.HttpChannel:396 |::] /timur-test/AUTH_test/test/-bash_logout
java.lang.IllegalStateException: s=DISPATCHED i=true a=null
at org.eclipse.jetty.server.HttpChannelState.handling(HttpChannelState.java:232)
at org.eclipse.jetty.server.HttpChannel.badMessage(HttpChannel.java:724)
at org.eclipse.jetty.server.HttpConnection$HttpChannelOverHttp.badMessage(HttpConnection.java:529)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1362)
at org.eclipse.jetty.server.HttpConnection.parseContent(HttpConnection.java:305)
at org.eclipse.jetty.server.HttpInputOverHTTP.nextContent(HttpInputOverHTTP.java:90)
at org.eclipse.jetty.server.HttpInputOverHTTP.nextContent(HttpInputOverHTTP.java:31)
at org.eclipse.jetty.server.HttpInput.getNextContent(HttpInput.java:143)
at org.eclipse.jetty.server.HttpInputOverHTTP.blockForContent(HttpInputOverHTTP.java:69)
at org.eclipse.jetty.server.HttpInput$1.waitForContent(HttpInput.java:489)
at org.eclipse.jetty.server.HttpInput.read(HttpInput.java:122)
at com.google.common.hash.HashingInputStream.read(HashingInputStream.java:65)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at com.google.common.io.ByteStreams.copy(ByteStreams.java:175)
at com.google.common.io.ByteStreams.toByteArray(ByteStreams.java:220)
at org.jclouds.blobstore.TransientStorageStrategy.putBlob(TransientStorageStrategy.java:167)
S3Proxy should return a 501 error with the XML stating that the method is not implemented in such cases. I'll try to submit a PR for that.
Reference: https://forums.aws.amazon.com/message.jspa?messageID=561616