Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address warning: literal string will be frozen in the future warnings #462

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/httpclient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ def do_get_block(req, proxy, conn, &block)
conn.push(res)
return res
end
content = block ? nil : ''
content = block ? nil : ''.dup
res = HTTP::Message.new_response(content, req.header)
@debug_dev << "= Request\n\n" if @debug_dev
sess = @session_manager.query(req, proxy)
Expand Down
2 changes: 1 addition & 1 deletion lib/httpclient/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def reset_pos(io)
end

def dump_file(io, dev, sz)
buf = ''
buf = ''.dup
rest = sz
while rest > 0
n = io.read([rest, @chunk_size].min, buf)
Expand Down
2 changes: 1 addition & 1 deletion lib/httpclient/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ def read_body_rest
end

def empty_bin_str
str = ''
str = ''.dup
str.force_encoding('BINARY') if str.respond_to?(:force_encoding)
str
end
Expand Down
2 changes: 1 addition & 1 deletion lib/httpclient/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AddressableURI < Addressable::URI
# Overwrites the original definition just for one line...
def authority
self.host && @authority ||= (begin
authority = ""
authority = "".dup
if self.userinfo != nil
authority << "#{self.userinfo}@"
end
Expand Down