Changelog History
Page 2
-
v0.25.1 Changes
November 05, 2018- ๐ Fix
params.files
memoization #503. Thanks @mamantoha ๐
- ๐ Fix
-
v0.25.0 Changes
November 04, 2018๐ Crystal 0.27.0 support.
[breaking change] Added back
env.params.files
.Here's a fully working sample for reading a image file upload
image1
and saving it underpublic/uploads
.post "/upload" do |env| file = env.params.files["image1"].tmpfile file\_path = ::File.join [Kemal.config.public\_folder, "uploads/", file.filename]File.open(file\_path, "w") do |f| IO.copy(file, f)end"Upload ok"end
โ To test
curl -F "image1=@/Users/serdar/Downloads/kemal.png" http://localhost:3000/upload
- ๐ Cache HTTP routes to increase performance ๐ #493
-
v0.24.0 Changes
August 14, 2018๐ Crystal 0.26.0 support
[breaking change] Removed
env.params.files
. You can use Crystal's built-inHTTP::FormData.parse
insteadpost "/upload" do |env| HTTP::FormData.parse(env.request) do |upload| filename = file.filename if !filename.is\_a?(String) "No filename included in upload"else file\_path = ::File.join [Kemal.config.public\_folder, "uploads/", filename] File.open(file\_path, "w") do |f| IO.copy(file.tmpfile, f) end"Upload OK"endend
[breaking change] From now on to access dynamic url params in a WebSocket route you have to use:
ws "/:id" do |socket, context| id = context.ws_route_lookup.params["id"]end
[breaking change] Removed
_method
magic param.โ Added new exception page #466. Thanks @mamantoha ๐
๐ Support custom port binding. Thanks @straight-shoota ๐
Kemal.run do |config| server = config.server.not\_nil! server.bind\_tcp "127.0.0.1", 3000, reuse\_port: true server.bind\_tcp "0.0.0.0", 3001, reuse\_port: trueend
-
v0.23.0 Changes
June 17, 2018- ๐ฑ Crystal 0.25.0 support ๐
- โ Add
Kemal::Context.get?
to safely access context storage ๐ - ๐ [Security] Don't serve 404 image dynamically ๐
- ๐ฑ Disable
X-Powered-By
header #449. Thanks @Blacksmoke16 ๐
-
v0.22.0 Changes
December 29, 2017- ๐ฑ Crystal 0.24.1 support ๐
- ๐ฑ Only return string from route.#408 thanks @crisward ๐
- ๐ Don't crash on empty path when compiled in --release. #407 thanks @crisward ๐
- ๐ Rename
Kemal::CommonLogHandler
toKemal::LogHandler
andKemal::CommonExceptionHandler
toKemal::ExceptionHandler
. - ๐ Allow videos to be opened with correct mime type. #406 thanks @crisward ๐
- โ Add webm mime type.#413 thanks @reindeer-cafe ๐
-
v0.21.0 Changes
September 05, 2017- ๐ฑ Dynamically insert handlers ๐ช Fixes #376.
โ Add context to WebSocket. This allows one to use
HTTP::Server::Context
inws
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 supportingCORS
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 ๐
-
v0.20.0 Changes
July 01, 2017- ๐ Crystal 0.23.0 support! As always, Kemal is compatible with the latest major release of Crystal ๐
Great news everyone ๐ All handlers are now completely _ customizable _!. Use the default
Kemal
handlers or go wild, it's all up to you โDon't forget to add
Kemal::RouteHandler::INSTANCE
or your routes won't work!Kemal.config.handlers = [Kemal::InitHandler.new, YourHandler.new, Kemal::RouteHandler::INSTANCE]
You can also insert a handler into a specific position.
# This adds MyCustomHandler instance to 1 position. Be aware that the index starts from 0.add\_handler MyCustomHandler.new, 1
- โก๏ธ Updated Kilt to v0.4.0.
- ๐ Make
Route
aStruct
. This improves the performance of route declarations.
-
v0.19.0 Changes
May 09, 2017- ๐ Return no body for head route fixes #323. (thanks @crisward)
- โก๏ธ Update
radix
to0.3.8
. (thanks @waghanza) - User defined context store types. (thanks @neovitange)
class User property name end add_context_storage_type(User)
- Prevent `send_file returning filesize. (thanks @crisward)
- Dont call setup in
config#add_filter_handler
fixes #338.
-
v0.18.3 Changes
March 07, 2017- โ Remove
Gzip::Header
monkey patch since it's fixed inCrystal 0.21.1
.
- โ Remove
-
v0.18.2 Changes
February 24, 2017- ๐ Fix Gzip in Kemal Seems broken for static files. This was caused by
Gzip::Writer
inCrystal 0.21.0
and currently mitigated by monkey patchingGzip::Header
.
- ๐ Fix Gzip in Kemal Seems broken for static files. This was caused by