File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def wrap_response(http_response)
56
56
def expand_url ( params , url )
57
57
new_url = url
58
58
params . each do | key , value |
59
- new_url = new_url . gsub ( '{' + key . to_s + '}' , value )
59
+ new_url = new_url . gsub ( '{' + key . to_s + '}' , URI . escape ( value ) )
60
60
end
61
61
new_url
62
62
end
Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ module Hal
98
98
it "returns a duplicate Link with the expanded href" do
99
99
expect ( subject . expand ( bar : 'wiffle' ) . href ) . to eq "http://foo/wiffle"
100
100
end
101
+
102
+ it "returns a duplicate Link with the expanded href with URL escaping" do
103
+ expect ( subject . expand ( bar : 'wiffle meep' ) . href ) . to eq "http://foo/wiffle%20meep"
104
+ end
101
105
end
102
106
end
103
107
end
You can’t perform that action at this time.
0 commit comments