Compare commits

..

5 Commits

Author SHA1 Message Date
Luna 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
Luna 61af3854cb route_handler: remove auto-HEAD 2020-09-03 22:54:48 -03:00
Luna aa378b7a90 add head method to dsl 2020-09-03 22:54:48 -03:00
Luna 2f9f859be9 websocket: default to error code 500 on any websocket error 2020-09-03 22:54:48 -03:00
Luna 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
1 changed files with 1 additions and 1 deletions

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