Skip to content

Commit

Permalink
Add to check uri string includes ?
Browse files Browse the repository at this point in the history
  • Loading branch information
iguchi1124 committed Apr 29, 2018
1 parent f17ecc3 commit 2addf75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mustermann/lib/mustermann/expander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ def slice(hash, keys)

def append(uri, values)
return uri unless values and values.any?
Addressable::URI.encode([uri, QueryStringBuilder.new(values).build].join('?'))
Addressable::URI.encode(
[uri, uri.include?('?') ? '&' : '?', QueryStringBuilder.new(values).build].join
)
end

def map_values(values)
Expand Down

0 comments on commit 2addf75

Please sign in to comment.