Skip to content

Commit

Permalink
fix v4 uri path normalizing
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorfinnell committed Dec 21, 2017
1 parent 665a1f6 commit 64bc2ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/awscr-signer/v4/uri.cr
Expand Up @@ -32,13 +32,15 @@ module Awscr
io << "#{scheme}://#{@uri.host}#{@uri.path}"
end

# Returns the host of the UI
def host
@uri.host
end

# Returns path of the `Uri`, normalizes the path, and encode the path as
# required by version 4
def path
# Allows input of /test ing/ and /test%20ing/
uri = URI.parse(@uri.path.to_s).normalize
uri = @uri.normalize
path = uri.path.to_s
path = "/" if path.blank?
self.class.encode(path)
Expand Down

0 comments on commit 64bc2ce

Please sign in to comment.