method
each_response_header
v2_5_5 -
Show latest stable
- Class:
Net::HTTPResponse
each_response_header(sock)private
No documentation available.
# File lib/net/http/response.rb, line 52
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 Net::HTTPBadResponse, 'wrong header line format' if value.nil?
end
end
yield key, value if key
end