Compare commits

..

No commits in common. "bba5bef50506f7572db9fcdeb107c65709bf1244" and "3faba4e3fa844e16a395b77f4fde9eba6f11a708" have entirely different histories.

2 changed files with 3 additions and 6 deletions

View File

@ -4,14 +4,9 @@ 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?

View File

@ -50,9 +50,11 @@ 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: message
message: String.new(raw.to_slice) + message
)
raise error unless error.is_a?(WebsocketError)