Vapor: 4.33.0 Release

Release date:
October 27, 2020
Previous version:
4.32.1 (released October 26, 2020)
Magnitude:
97 Diff Delta
Contributors:
1 total committer
Data confidence:
Commits:

Top Contributors in 4.33.0

code28

Directory Browser for 4.33.0

We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.

Release Notes Published

This patch was authored by @code28 and released by @siemensikkema.

Adds support for a custom implementation of shouldUpgrade for websockets. This can be used to switch to specific subprotocols or to deny upgrading by returning nil.

routes.webSocket("authedecho", shouldUpgrade: { req in
    guard req.auth.has(User.self) else {
        return req.eventLoop.future(nil)
    }
    return req.eventLoop.future([:])            
}, onUpgrade: { req, ws in
    print(ws)
})