Lines Matching refs:header
35 # Response header
37 attr_reader :header
98 @header = Hash.new
129 # Retrieves the response header +field+
132 @header[field.downcase]
136 # Sets the response header +field+ to +value+
139 @header[field.downcase] = value.to_s
143 # The content-length header
152 # Sets the content-length header to +len+
159 # The content-type header
166 # Sets the content-type header to +type+
173 # Iterates over each header in the resopnse
176 @header.each{|field, value| yield(field, value) }
222 @header['server'] ||= @config[:ServerSoftware]
223 @header['date'] ||= Time.now.httpdate
243 @header.delete('content-length')
246 @header["transfer-encoding"] = "chunked"
247 @header.delete('content-length')
248 elsif %r{^multipart/byteranges} =~ @header['content-type']
249 @header.delete('content-length')
250 elsif @header['content-length'].nil?
252 @header['content-length'] = @body ? @body.bytesize : 0
257 if @header['connection'] == "close"
260 if chunked? || @header['content-length'] || @status == 304 || @status == 204 || HTTPStatus.info?(@status)
261 @header['connection'] = "Keep-Alive"
265 @header['connection'] = "close"
269 @header['connection'] = "close"
273 if location = @header['location']
275 @header['location'] = @request_uri.merge(location)
286 @header.each{|key, value|
323 @header['location'] = url.to_s
339 @header['content-type'] = "text/html; charset=ISO-8859-1"
405 size = @header['content-length'].to_i