method
each_response_header
each_response_header(sock)
private
Hide source
# File lib/net/http.rb, line 2231 def each_response_header(sock) key = value = nil while true line = sock.readuntil("\n", true).sub(/\s+\z/, '') break if line.empty? if line[0] == \s\ or line[0] == \t\ and value value << ' ' unless value.empty? value << line.strip else yield key, value if key key, value = line.strip.split(/\s*:\s*/, 2) raise HTTPBadResponse, 'wrong header line format' if value.nil? end end yield key, value if key end