Skip to content

4.94.1 - Patch configuration and log actual port on startup

Compare
Choose a tag to compare
@penny-for-vapor penny-for-vapor released this 26 Apr 19:56
· 7 commits to main since this release
e5cb0ab

What's Changed

Patch configuration and log actual port on startup by @bisgardo in #3160

Before this change, the application

let app = Application(.testing)
defer { app.shutdown() }
try app.server.start(hostname: nil, port: 0)
defer { app.server.shutdown() }

would log the following message before starting the server:

[Vapor] Server starting on http://127.0.0.1:0

After this change it instead logs a message like the following after starting the server:

[Vapor] Server starting on http://127.0.0.1:57935

The input configuration is also patched such that app.http.server.configuration.port will hold the actual port after startup. Currently if it has value 0 it will keep that value (only app.http.server.shared.localAddress?.port will have the correct one).

Fixes #3159.

Reviewers

Thanks to the reviewers for their help:

This patch was released by @0xTim

Full Changelog: 4.94.0...4.94.1