Skip to content

Releases: vapor/vapor

4.101.3 - Fix decoding 'flag' URL query params via `.decode(StructType.self)`

10 Jun 23:11
f1c3495
Compare
Choose a tag to compare

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 of req.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

04 Jun 21:53
a46552b
Compare
Choose a tag to compare

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

29 May 09:42
12e9b41
Compare
Choose a tag to compare

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 URIs.

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

24 May 10:38
cc98361
Compare
Choose a tag to compare

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

21 May 20:19
2c185b7
Compare
Choose a tag to compare

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

20 May 16:06
50c6196
Compare
Choose a tag to compare

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 rules

The 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

15 May 11:56
90da64a
Compare
Choose a tag to compare

What's Changed

Add Async Lifecycle Handlers by @0xTim in #3193

Adds new protocol functions to LifecycleHandlers 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

13 May 15:07
5bc1dfa
Compare
Choose a tag to compare

What's Changed

Async Serve Command by @0xTim in #3190

Migrate ServeCommand to an AsyncCommand to enable proper custom executor support and remove any calls to wait()

This patch was released by @0xTim

Full Changelog: 4.99.2...4.99.3

4.99.2 - Support compiling against Musl

12 May 22:54
d9fa0d3
Compare
Choose a tag to compare

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 of Musl. However, there are a couple of other places where Glibc 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

12 May 19:15
8353aed
Compare
Choose a tag to compare

What's Changed

Fix availability message by @valeriyvan in #3191

This patch was released by @0xTim

Full Changelog: 4.99.0...4.99.1