mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Update CHANGELOG
This commit is contained in:
parent
4a58bc9690
commit
ffaf6ff1f9
1 changed files with 22 additions and 11 deletions
33
CHANGELOG.md
33
CHANGELOG.md
|
@ -1,23 +1,34 @@
|
||||||
# Next
|
# 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
|
```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"
|
||||||
if !filename.is_a?(String)
|
else
|
||||||
"No filename included in upload"
|
file_path = ::File.join [Kemal.config.public_folder, "uploads/", filename]
|
||||||
else
|
File.open(file_path, "w") do |f|
|
||||||
file_path = ::File.join [Kemal.config.public_folder, "uploads/", filename]
|
IO.copy(file.tmpfile, f)
|
||||||
File.open(file_path, "w") do |f|
|
end
|
||||||
IO.copy(file.tmpfile, f)
|
"Upload OK"
|
||||||
end
|
end
|
||||||
"Upload OK"
|
|
||||||
end
|
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)
|
# 0.23.0 (17-06-2018)
|
||||||
|
|
||||||
- Crystal 0.25.0 support 🎉
|
- Crystal 0.25.0 support 🎉
|
||||||
|
|
Loading…
Reference in a new issue