Skip to content

Commit

Permalink
Merge pull request #1 from jkugiya/fix/use_encoded_asterisk
Browse files Browse the repository at this point in the history
Fixes path problem
  • Loading branch information
jkugiya authored Jun 8, 2017
2 parents f6048dd + daf8f09 commit 5c9968b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name := "aws-v4-signer-scala"
organization := "com.github.jkugiya"

version := "0.12"
version := "0.13"

scalaVersion := "2.11.8"

Expand Down
11 changes: 9 additions & 2 deletions src/main/scala/jkugiya/awstools/signer/v4/HttpRequest.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
package jkugiya.awstools.signer.v4

import java.net.URI
import java.net.{ URI, URLEncoder }

case class HttpRequest(method: String, uri: URI) {

val path =
if (uri.getPath.isEmpty) "/"
else uri.getPath
else {
val path =
uri.getPath.substring(1, uri.getPath.length)
.split("/")
.map(URLEncoder.encode(_, "UTF-8").replaceAll("\\*", "%2A"))
.mkString("/")
"/" + path
}

val query =
Option(uri.getQuery).getOrElse("")
Expand Down

0 comments on commit 5c9968b

Please sign in to comment.