Skip to content

Commit

Permalink
chore(to_url): add path ivar & params to signature method
Browse files Browse the repository at this point in the history
  • Loading branch information
luqven committed Apr 13, 2021
1 parent b912bfe commit bd5bdec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/imgix/path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ def initialize(prefix, secure_url_token, path = "/")
end

def to_url(opts = {})
@path = sanitize_path(@path)
sanitized_path ||= sanitize_path(@path)
prev_options = @options.dup
@options.merge!(opts)

current_path_and_params = path_and_params
current_path_and_params = path_and_params(sanitized_path)
url = @prefix + current_path_and_params

if @secure_url_token
Expand Down Expand Up @@ -161,12 +161,12 @@ def encode_URI(path)
return result;
end

def signature(path_and_params)
Digest::MD5.hexdigest(@secure_url_token + path_and_params)
def signature(rest)
Digest::MD5.hexdigest(@secure_url_token + rest)
end

def path_and_params
has_query? ? "#{@path}?#{query}" : @path
def path_and_params(path)
has_query? ? "#{path}?#{query}" : path
end

def query
Expand Down

0 comments on commit bd5bdec

Please sign in to comment.