Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AWS S3 url encoding bug #316

Closed
francisdb opened this issue Jun 1, 2017 · 0 comments
Closed

AWS S3 url encoding bug #316

francisdb opened this issue Jun 1, 2017 · 0 comments
Milestone

Comments

@francisdb
Copy link
Contributor

francisdb commented Jun 1, 2017

We have a bucket object with a a space in it's key

val key = "my object"
S3Client.download(bucket, key)

fails with the following error

akka.http.scaladsl.model.IllegalUriException: Illegal URI reference: Invalid input ' ', expected '/', 'EOI', '#', '?' or pchar (line 1, column 34): /waylay.plugins/app.templates/CO2 OK template
                                 ^
    at akka.http.scaladsl.model.IllegalUriException$.apply(ErrorInfo.scala:40)
    at akka.http.scaladsl.model.Uri$.fail(Uri.scala:752)
    at akka.http.impl.model.parser.UriParser.fail(UriParser.scala:80)
    at akka.http.impl.model.parser.UriParser.parseUriReference(UriParser.scala:45)
    at akka.http.scaladsl.model.Uri$.apply(Uri.scala:209)
    at akka.http.scaladsl.model.Uri$.apply(Uri.scala:181)
    at akka.stream.alpakka.s3.impl.HttpRequests$.requestUri(HttpRequests.scala:111)
    at akka.stream.alpakka.s3.impl.HttpRequests$.akka$stream$alpakka$s3$impl$HttpRequests$$s3Request(HttpRequests.scala:87)
    at akka.stream.alpakka.s3.impl.HttpRequests$.getDownloadRequest(HttpRequests.scala:39)
    at akka.stream.alpakka.s3.impl.S3Stream.request(S3Stream.scala:93)
    at akka.stream.alpakka.s3.impl.S3Stream.download(S3Stream.scala:63)
    at akka.stream.alpakka.s3.scaladsl.S3Client.download(S3Client.scala:50)

the case with a key of for example "my dir/my object.json" should also work (no encoding of the /'s)

when manually replacing " " with "%20" I get 403 Forbidden which indicates the signing is also broken with these kinds of url's

(the official client happily accepts keys with spaces)

@2m 2m closed this as completed in 05c4b9a Jun 22, 2017
@2m 2m added this to the 0.10 milestone Jun 22, 2017
Scalahansolo pushed a commit to Scalahansolo/alpakka that referenced this issue Jun 23, 2017
…#342)

fix akka#316 corrects S3 url path handling for keys with spaces
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants