kemal/src/kemal/ext/response.cr

15 lines
364 B
Crystal
Raw Normal View History

class HTTP::Server::Response
class Output
def close
2019-08-30 11:32:23 +00:00
# ameba:disable Style/NegatedConditionsInUnless
if !response.wrote_headers? && !response.headers.has_key?("Content-Range") && !response.headers.has_key?("Content-Length")
response.content_length = @out_count
end
ensure_headers_written
previous_def
end
end
end