diff --git a/FORK.md b/FORK.md index 85efc10..61f1b1f 100644 --- a/FORK.md +++ b/FORK.md @@ -4,9 +4,14 @@ This is the outline of the changes done in this fork, compared to Kemal upstream - Default HEAD request removed has been removed. If you wish to provide it, you must give your own handler. + - Can not be upstreamed as it would be a breaking change that I did not + ask upstream about. This is a very specific issue to the web services I + write. - Fix to prevent overwriting the `content-length` header value when set by the request handler. + - Could be upstreamed, as it is a single line fix. - Websockets can be closed via an exception, with support for reasons. + - Can not be upstreamed. Same reasoning as the first change. ## Installation? diff --git a/src/kemal/websocket.cr b/src/kemal/websocket.cr index b9e4d63..b06e9a7 100644 --- a/src/kemal/websocket.cr +++ b/src/kemal/websocket.cr @@ -50,11 +50,9 @@ module Kemal message = "Exception" end - raw = uninitialized UInt8[2] - IO::ByteFormat::BigEndian.encode(code, raw.to_slice) socket.not_nil!.close( HTTP::WebSocket::CloseCode.new(code), - message: String.new(raw.to_slice) + message + message: message ) raise error unless error.is_a?(WebsocketError)