kemal v0.21.0 Release Notes

Release Date: 2017-09-05 // about 4 years ago
    • ๐Ÿฑ Dynamically insert handlers ๐Ÿ’ช Fixes #376.
    • โž• Add context to WebSocket. This allows one to use HTTP::Server::Context in ws declarations ๐Ÿ˜ Fixes #349.

      ws "/:room_name" do |socket, env| env.params.url["room_name"]end

    • โž• Add support for customizing the headers of built-in Kemal::StaticFileHandler ๐Ÿ”จ Useful for supporting CORS for single page applications ๐Ÿ‘

      static_headers do |response, filepath, filestat| if filepath =~ /.html$/ response.headers.add("Access-Control-Allow-Origin", "*") end response.headers.add("Content-Size", filestat.size.to_s) endend

    ๐Ÿ‘ Allow %w in Handler macros #385. Thanks @will ๐Ÿ™

    ๐Ÿ”’ Security: X-Content-Type-Options: nosniff for static files. Fixes #379. Thanks @crisward ๐Ÿ™

    ๐ŸŽ Performance: Remove tempfile management to OS. This brings %10 - 15 performance boost to Kemal ๐Ÿš€