Skip to content

Commit

Permalink
Avoid mutating @url_path to avoid unexpected side effects
Browse files Browse the repository at this point in the history
  • Loading branch information
tachyons committed Oct 31, 2018
1 parent 44f27cf commit 19f935b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/ruby_http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ def add_ssl(http)
# - Client object
#
def _(name = nil)
url_path = name ? @url_path.push(name) : @url_path
@url_path = []
url_path = name ? @url_path + [name] : @url_path
Client.new(host: @host, request_headers: @request_headers,
version: @version, url_path: url_path,
http_options: @http_options)
Expand Down

0 comments on commit 19f935b

Please sign in to comment.