2022-02-20 21:27:02 +00:00
|
|
|
# This override collides with the new stdlib of Crystal 1.3
|
|
|
|
# See https://github.com/kemalcr/kemal/issues/627 for more details
|
|
|
|
{{ skip_file if compare_versions(Crystal::VERSION, "1.3.0") >= 0 }}
|
|
|
|
|
2017-02-04 10:06:43 +00:00
|
|
|
class HTTP::Server::Response
|
|
|
|
class Output
|
|
|
|
def close
|
2019-08-30 11:32:23 +00:00
|
|
|
# ameba:disable Style/NegatedConditionsInUnless
|
2020-09-04 01:46:19 +00:00
|
|
|
if !response.wrote_headers? && !response.headers.has_key?("Content-Range") && !response.headers.has_key?("Content-Length")
|
2017-02-04 10:06:43 +00:00
|
|
|
response.content_length = @out_count
|
|
|
|
end
|
|
|
|
|
|
|
|
ensure_headers_written
|
|
|
|
|
2020-07-08 11:41:16 +00:00
|
|
|
previous_def
|
2017-02-04 10:06:43 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|