class Rack::Lint::Wrapper
def check_content_length_header(status, headers)
# ==== The +content-length+ Header
#
def check_content_length_header(status, headers) headers.each { |key, value| if key == 'content-length' ## There must not be a <tt>content-length</tt> header key when the ## +Status+ is 1xx, 204, or 304. if Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.key? status.to_i raise LintError, "content-length header found in #{status} response, not allowed" end @content_length = value end } end