Releases: vapor/vapor
4.101.3 - Fix decoding 'flag' URL query params via `.decode(StructType.self)`
What's Changed
Fix decoding 'flag' URL query params via .decode(StructType.self)
by @challfry in #3164
Fixes #3163.
The code:
struct QueryStruct: Content { var flag1: Bool? } let queryStruct = try req.query.decode(QueryStruct.self)
produces
queryStruct.flag1 == true
when decoding the URL query “?flag1”, matching the behavior ofreq.query[Bool.self, at: "flag1"]
.
New Contributor
This patch was released by @0xTim
Full Changelog: 4.101.2...4.101.3
4.101.2 - Adds TIFF and WebP HTTP Media Types
What's Changed
Adds TIFF and WebP HTTP Media Types by @qalandarov in #3194
Add additional image types:
app.post("upload") { req in guard [.jpeg, .png, .tiff, .webp].contains(req.content.contentType) else { throw Abort(.unsupportedMediaType) } // ... }
This patch was released by @0xTim
Full Changelog: 4.101.1...4.101.2
4.101.1 - Exclude Query and Fragment from URI semicolon fix on Linux
On Linux, URLComponents
does not have 100% the same behavior like on macOS. Vapor accounts for this unfixed bug by replacing percent-encoded semicolon %3B
with ;
in URI
s.
This is however not fully correct, because if a URI contains a percent encoded semicolon, this might have a different meaning, than when it is not percent encoded, compare the following sentence from RFC 3986:
A percent-encoding mechanism is used to represent a data octet in a
component when that octet's corresponding character is outside the
allowed set or is being used as a delimiter of, or within, the component.
This PR aims to limit the impact of the required semicolon fix by ensuring that query and fragments are not unnecessarily and incorrectly modified.
Hopefully, in a future with the new swift-foundation this fix will not be needed anymore. But for now it would solve an issue on our side which is related to the concept of a signed request.
4.101.0 - Add Async Storage shutdown
What's Changed
Add Async Storage shutdown by @0xTim in #3196
Currently running
Task { try? await Task.sleep(for: .seconds(5)) app.running?.stop() }When you try and install NIO as the global executor will crash because the storage API didn’t have any async entry points so stopping would trigger a synchronous shutdown, with a
wait()
. This fixes that
This patch was released by @0xTim
Full Changelog: 4.100.2...4.101.0
4.100.2 - asyncBoot will no longer try booting server again if it is already booted
What's Changed
asyncBoot will no longer try booting server again if it is already booted by @RussBaz in #3195
The synchronous
boot
function skips running the lifecycle handlers if the server is already booted. However, the async version ignored this check. I have added a small fix to add this check again.
This patch was released by @0xTim
Full Changelog: 4.100.1...4.100.2
4.100.1 - Update URLEncodedFormEncoder encoding rules
What's Changed
Update URLEncodedFormEncoder encoding rules by @ptoffy in #3192
Solves #3173
References https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set to set the encoding rulesThe application/x-www-form-urlencoded percent-encode set contains all code points, except the ASCII alphanumeric, U+002A (*), U+002D (-), U+002E (.), and U+005F (_).
This patch was released by @0xTim
Full Changelog: 4.100.0...4.100.1
4.100.0 - Add Async Lifecycle Handlers
What's Changed
Add Async Lifecycle Handlers by @0xTim in #3193
Adds new protocol functions to
LifecycleHandler
s to support async contexts. This is important because packages like Redis use this to know when to shutdown their connection pool. In the shutdown function, these call.wait()
which can cause application crashes if called when trying to use NIO’s event loop concurrency executor.This provides async alternatives to allow packages to provide full async calls through their stack to avoid these crashes
This patch was released by @0xTim
Full Changelog: 4.99.3...4.100.0
4.99.3 - Async Serve Command
What's Changed
Async Serve Command by @0xTim in #3190
Migrate
ServeCommand
to anAsyncCommand
to enable proper custom executor support and remove any calls towait()
This patch was released by @0xTim
Full Changelog: 4.99.2...4.99.3
4.99.2 - Support compiling against Musl
What's Changed
Support compiling against Musl by @simonjbeaumont in #3188
Vapor already makes some provision for compiling against Musl in the RFC1123 implementation, where
Glibc
is not assumed and is imported conditionally alongside a conditional import ofMusl
. However, there are a couple of other places whereGlibc
is still assumed when compiling for Linux.This patch replaces these imports with the same
#if canImport(...)
pattern.
This patch was released by @0xTim
Full Changelog: 4.99.1...4.99.2
4.99.1 - Fix availability message
What's Changed
Fix availability message by @valeriyvan in #3191
This patch was released by @0xTim
Full Changelog: 4.99.0...4.99.1