don't overwrite content-length if its already there

we shouldn't overwrite something that the client likely did it
willlingly
This commit is contained in:
Luna 2020-09-03 22:46:19 -03:00
parent 61af3854cb
commit 845ccb10ab

View file

@ -2,7 +2,7 @@ class HTTP::Server::Response
class Output class Output
def close def close
# ameba:disable Style/NegatedConditionsInUnless # ameba:disable Style/NegatedConditionsInUnless
unless response.wrote_headers? && !response.headers.has_key?("Content-Range") if !response.wrote_headers? && !response.headers.has_key?("Content-Range") && !response.headers.has_key?("Content-Length")
response.content_length = @out_count response.content_length = @out_count
end end