2016-11-23 17:47:13 +00:00
|
|
|
# 0.17.0 (23-11-2016)
|
2016-10-28 09:37:11 +00:00
|
|
|
|
|
|
|
- Reimplemented Request middleware / filter routing.
|
|
|
|
|
|
|
|
Now all requests will first go through the Middleware stack then Filters (before_*) and will finally reach the matching route.
|
|
|
|
|
|
|
|
Which is illustrated as,
|
|
|
|
|
|
|
|
```
|
|
|
|
Request -> Middleware -> Filter -> Route
|
|
|
|
```
|
|
|
|
|
2016-11-01 08:46:13 +00:00
|
|
|
- Rename `return_with` as `halt`.
|
2016-11-04 08:12:35 +00:00
|
|
|
- Route declaration must start with `/`. Fixes [#242](https://github.com/sdogruyol/kemal/issues/242)
|
2016-11-06 08:59:17 +00:00
|
|
|
- Set default exception Content-Type to text/html. Fixes [#202](https://github.com/sdogruyol/kemal/issues/242)
|
2016-11-09 16:17:29 +00:00
|
|
|
- Add `only` and `exclude` paths for `Kemal::Handler`. This change requires that all handlers must inherit from `Kemal::Handler`.
|
|
|
|
|
|
|
|
For example this handler will only work on `/` path. By default the HTTP method is `GET`.
|
|
|
|
|
|
|
|
|
|
|
|
```crystal
|
|
|
|
OnlyHandler < Kemal::Handler
|
|
|
|
only ["/"]
|
|
|
|
|
|
|
|
def call(env)
|
|
|
|
return call_next(env) unless only_match?(env)
|
|
|
|
puts "If the path is / i will be doing some processing here."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
The handlers using `exclude` will work on the paths that isn't specified. For example this handler will work on any routes other than `/`.
|
|
|
|
|
|
|
|
```crystal
|
|
|
|
ExcludeHandler < Kemal::Handler
|
|
|
|
exclude ["/"]
|
|
|
|
|
|
|
|
def call(env)
|
|
|
|
return call_next(env) unless only_match?(env)
|
|
|
|
puts "If the path is NOT / i will be doing some processing here."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
2016-11-12 18:30:01 +00:00
|
|
|
- Close response on `halt`. (thanks @samueleaton).
|
|
|
|
- Update `Radix` to `v0.3.4`.
|
2016-11-16 17:27:01 +00:00
|
|
|
- `error` handler now also yields error. For example you can get the error mesasage like
|
|
|
|
|
|
|
|
```crystal
|
|
|
|
error 500 do |env, err|
|
|
|
|
err.message
|
|
|
|
end
|
|
|
|
```
|
2016-11-01 08:46:13 +00:00
|
|
|
|
2016-11-23 17:47:13 +00:00
|
|
|
- Update `multipart.cr` to `v0.1.1`
|
|
|
|
|
2016-10-12 13:56:40 +00:00
|
|
|
# 0.16.1 (12-10-2016)
|
|
|
|
|
|
|
|
- Improved Multipart support with more info on parsed files. `parse_multipart(env)` now yields
|
|
|
|
an `UploadFile` object which has the following properties `field`,`data`,`meta`,`headers.
|
|
|
|
|
|
|
|
```crystal
|
|
|
|
post "/upload" do |env|
|
|
|
|
parse_multipart(env) do |f|
|
|
|
|
image1 = f.data if f.field == "image1"
|
|
|
|
image2 = f.data if f.field == "image2"
|
|
|
|
puts f.meta
|
|
|
|
puts f.headers
|
|
|
|
"Upload complete"
|
|
|
|
end
|
|
|
|
end
|
2016-10-20 14:21:37 +00:00
|
|
|
```
|
2016-10-12 13:56:40 +00:00
|
|
|
|
2016-10-01 15:50:24 +00:00
|
|
|
# 0.16.0
|
2016-09-15 18:20:18 +00:00
|
|
|
|
2016-10-01 15:50:24 +00:00
|
|
|
- Multipart support <3 (thanks @RX14). Now you can handle file uploads.
|
2016-10-02 15:33:28 +00:00
|
|
|
|
|
|
|
```crystal
|
|
|
|
post "/upload" do |env|
|
|
|
|
parse_multipart(env) do |field, data|
|
|
|
|
image1 = data if field == "image1"
|
|
|
|
image2 = data if field == "image2"
|
|
|
|
"Upload complete"
|
|
|
|
end
|
|
|
|
end
|
2016-10-01 15:50:24 +00:00
|
|
|
```
|
2016-10-02 15:33:28 +00:00
|
|
|
|
2016-10-01 15:50:24 +00:00
|
|
|
- Make session configurable. Now you can specify session name and expire time wit
|
2016-10-02 15:33:28 +00:00
|
|
|
|
|
|
|
```crystal
|
|
|
|
Kemal.config.session["name"] = "your_app"
|
|
|
|
Kemal.config.session["expire_time"] = 48.hours
|
|
|
|
```
|
|
|
|
|
2016-10-01 15:50:24 +00:00
|
|
|
- Session now supports more types. (String, Int32, Float64, Bool)
|
2016-09-15 18:20:18 +00:00
|
|
|
- Add `gzip` helper to enable / disable gzip compression on responses.
|
2016-09-20 23:32:09 +00:00
|
|
|
- Static file caching with etag and gzip (thanks @crisward)
|
|
|
|
- `Kemal.run` now accepts port to listen.
|
2016-09-15 18:20:18 +00:00
|
|
|
|
2016-10-12 13:56:40 +00:00
|
|
|
# 0.15.1 (05-09-2016)
|
2016-09-15 18:20:18 +00:00
|
|
|
|
|
|
|
- Don't forget to call_next on NullLogHandler
|
|
|
|
|
2016-09-03 14:14:22 +00:00
|
|
|
# 0.15.0 (03-09-2016)
|
2016-09-02 12:21:42 +00:00
|
|
|
|
2016-09-02 14:12:34 +00:00
|
|
|
- Add context store
|
|
|
|
- `KEMAL_ENV` respects to `Kemal.config.env` and needs to be explicitly set.
|
|
|
|
- `Kemal::InitHandler` is introduced. Adds initial configuration, headers like `X-Powered-By`.
|
|
|
|
- Add `send_file` to helpers.
|
|
|
|
- Add mime types.
|
|
|
|
- Fix parsing JSON params when "charset" is present in "Content-Type" header.
|
|
|
|
- Use http-only cookie for session
|
2016-10-20 14:21:37 +00:00
|
|
|
- Inject STDOUT by default in CommonLogHandler
|