Compare commits

..

5 commits

Author SHA1 Message Date
845ccb10ab don't overwrite content-length if its already there
we shouldn't overwrite something that the client likely did it
willlingly
2020-09-03 22:54:48 -03:00
61af3854cb route_handler: remove auto-HEAD 2020-09-03 22:54:48 -03:00
aa378b7a90 add head method to dsl 2020-09-03 22:54:48 -03:00
2f9f859be9 websocket: default to error code 500 on any websocket error 2020-09-03 22:54:48 -03:00
19bc38b881 add support for error codes on websockets
copied from 541dfc9da5/src/onyx-http/middleware/router/websocket_handler.cr (L36)
2020-09-03 22:54:48 -03:00

View file

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