Update CHANGELOG

This commit is contained in:
Serdar Dogruyol 2018-07-04 22:04:22 +03:00
parent 4a58bc9690
commit ffaf6ff1f9
1 changed files with 22 additions and 11 deletions

View File

@ -1,23 +1,34 @@
# Next
- `env.params.files` is now an `Array(FileUpload)`. You can iterate over to access the images.
- *[breaking change]* Removed `env.params.files`. You can use Crystal's built-in `HTTP::FormData.parse` instead
```ruby
env.params.files.each do |file|
post "/upload" do |env|
HTTP::FormData.parse(env.request) do |upload|
filename = file.filename
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)
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"
end
"Upload OK"
end
```
- *[breaking change]* From now on to access dynamic url params in a WebSocket route you have to use
```ruby
ws "/:id" do |socket, context|
id = context.ws_route_lookup.params["id"]
end
```
- *[breaking change]* Removed `_method` magic param
# 0.23.0 (17-06-2018)
- Crystal 0.25.0 support 🎉