kaliber-scala / play-s3

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

SignatureDoesNotMatch when s3.host contains portnumber #71

Open jtjeferreira opened 7 years ago

jtjeferreira commented 7 years ago

When I specify the s3.host as localhost:8000 requests fail with this error. If I specify localhost and the server is running on 80 it succeeds.

fly.play.s3.S3Exception: Problem accessing S3. Status 403, code SignatureDoesNotMatch, message 'SignatureDoesNotMatch'
Original xml:
Some(<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided.</Message><Resource/><RequestId>32f1e8d3caada463ec4c</RequestId></Error>)
    at fly.play.s3.S3Exception$.apply(S3Exception.scala:15) ~[play-s3_2.11-7.0.2.jar:7.0.2]
    at fly.play.s3.S3Response$.apply(S3Response.scala:9) ~[play-s3_2.11-7.0.2.jar:7.0.2]
    at fly.play.s3.Bucket$$anonfun$unitResponse$2.apply(Bucket.scala:273) ~[play-s3_2.11-7.0.2.jar:7.0.2]
    at fly.play.s3.Bucket$$anonfun$unitResponse$2.apply(Bucket.scala:273) ~[play-s3_2.11-7.0.2.jar:7.0.2]
    at scala.util.Success$$anonfun$map$1.apply(Try.scala:237) ~[scala-library-2.11.8.jar:na]
    at scala.util.Try$.apply(Try.scala:192) ~[scala-library-2.11.8.jar:na]
    at scala.util.Success.map(Try.scala:237) ~[scala-library-2.11.8.jar:na]
    at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:237) ~[scala-library-2.11.8.jar:na]
    at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:237) ~[scala-library-2.11.8.jar:na]
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) ~[scala-library-2.11.8.jar:na]

I found the solution from a similar issue on https://github.com/scality/S3/issues/84

I will try to work on a PR later