Project

General

Profile

Feature #16773 ยป patch1.diff

timcraft (Tim Craft), 04/10/2020 11:35 AM

View differences:

lib/net/http/generic_request.rb
1
# frozen_string_literal: false
1
# frozen_string_literal: true
2 2
# HTTPGenericRequest is the parent of the Net::HTTPRequest class.
3 3
# Do not use this directly; use a subclass of Net::HTTPRequest.
4 4
#
......
241 241
    boundary ||= SecureRandom.urlsafe_base64(40)
242 242
    chunked_p = chunked?
243 243

  
244
    buf = ''
244
    buf = ''.dup
245 245
    params.each do |key, value, h={}|
246 246
      key = quote_string(key, charset)
247 247
      filename =
......
326 326
    if /[\r\n]/ =~ reqline
327 327
      raise ArgumentError, "A Request-Line must not contain CR or LF"
328 328
    end
329
    buf = ""
329
    buf = ''.dup
330 330
    buf << reqline << "\r\n"
331 331
    each_capitalized do |k,v|
332 332
      buf << "#{k}: #{v}\r\n"
lib/net/http/header.rb
1
# frozen_string_literal: false
1
# frozen_string_literal: true
2 2
# The HTTPHeader module defines methods for reading and writing
3 3
# HTTP headers.
4 4
#
lib/net/http/response.rb
1
# frozen_string_literal: false
1
# frozen_string_literal: true
2 2
# HTTP response class.
3 3
#
4 4
# This class wraps together the response header and the response body (the
......
345 345
    if block
346 346
      Net::ReadAdapter.new(block)
347 347
    else
348
      dest || ''
348
      dest || ''.dup
349 349
    end
350 350
  end
351 351