Skip to content

Commit 37fb694

Browse files
Merge pull request #108 from tachyons/fix_93
Avoid mutating @url_path to avoid unexpected side effects
2 parents 5d7f4bd + 19f935b commit 37fb694

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/ruby_http_client.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ def add_ssl(http)
212212
# - Client object
213213
#
214214
def _(name = nil)
215-
url_path = name ? @url_path.push(name) : @url_path
216-
@url_path = []
215+
url_path = name ? @url_path + [name] : @url_path
217216
Client.new(host: @host, request_headers: @request_headers,
218217
version: @version, url_path: url_path,
219218
http_options: @http_options)

0 commit comments

Comments
 (0)