Paths with special characters and spaces return SignatureDoesNotMatch
Closed this issue · 2 comments
mhzajac commented
I'm not sure whether or not it is intended for paths to be encoded prior to passing to fly.s3 functions, but I'm having trouble getting this to work:
bucket add BucketFile("sample/test file.txt", "text/plain", content, Some(PRIVATE)) // will not work without URL encoding
bucket add BucketFile("sample/test&;-file.txt", "text/plain", content, Some(PRIVATE)) // works without URL encoding
bucket add BucketFile("sample/test & file.txt", "text/plain", content, Some(PRIVATE)) // will not work either way, URL encoding the path first will return SignatureDoesNotMatch
bucket add BucketFile("sample/test+&+file.txt", "text/plain", content, Some(PRIVATE)) // this will work (changing only the spaces), but is a hack
EECOLOR commented
Note that you still need to create your BucketFile
like this: BucketFile(URLEncoder.encode(name, "UTF-8"), ...)
I can not make the bucket automatically url encode the file name because that would break backward compatibility.
mhzajac commented
Thanks for the quick response. Allowing special characters has become an unfortunate reality for me, so this helps immensely.