kaliber-scala / play-s3

S3 module for Play
MIT License
119 stars 49 forks source link

Signature error on non-special url-encoded characters s3 #89

Open hodga opened 6 years ago

hodga commented 6 years ago

To reproduce: try to put a file with the name a's.txt or something.

The ' character makes it give a signature error, but S3 should accept this character in file names.

Hopefully I did not miss anything in the docs, but with everything else being so straight forward i kind of expected this also to "just work" :)

EECOLOR commented 6 years ago

Hey @hodga, in order for someone to more easily pick up this issue you should fork the repository and add a test case to https://github.com/kaliber-scala/play-s3/blob/master/src/test/scala/fly/play/aws/Aws4SignerSpec.scala

You are welcome to fix the the problem yourself and provide a pull request.

the documentation of the signing can be found here: http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html

hodga commented 6 years ago

It seemed simple enough at first, turns out it wasn't, but here is a PR: https://github.com/kaliber-scala/play-s3/pull/91

hodga commented 6 years ago

For people with the same issue the workaround is to encode the filename using AwsUrlEncoder.encodePath:

BucketFile(AwsUrlEncoder.encodePath("a's.txt"), _, _)