All Versions
59
Latest Version
Avg Release Cycle
6 days
Latest Release
1258 days ago

Changelog History
Page 4

  • v4.7.0 Changes

    May 27, 2020

    ๐Ÿš€ ###### This patch was authored and released by @tanner0101.

    • Implements new state machine for handling streaming request bodies (#2357).

    This new state machine ensures that calls to req.body.drain will only ever happen after the previously returned future has completed. This makes it easier to correctly implement streaming file writes. Addresses https://forums.swift.org/t/how-to-use-nonblockingfileio-for-repeated-writes/36206.

    • ๐Ÿ›  Request bodies are now automatically drained after sending a response (#2357, fixes #2356).

    This change ensures that streaming requests will be read completely even if a route ignores their body.

    โž• Adds a streaming file upload example to the Development executable (#2357).

    ๐Ÿ‘Œ Improves BodyStreamResult's normal and debug descriptions (#2357).

    ๐Ÿ›  Fixed a reference cycle if Request was captured strongly within the body.drain closure (#2357).

  • v4.6.0 Changes

    May 26, 2020

    ๐Ÿš€ ###### This patch was authored and released by @gwynne.

    Clean up Environment's implementation.

    Add the ability to specify the application environment using the environment variable VAPOR_ENV ( partial implementation of #2333). If both VAPOR_ENV and --env are provided, the latter always takes precedence.

    ๐Ÿ— Environment now recognizes and strips the spurious arguments Xcode passes to test runners when a scheme doesn't specify any arguments of its own. It will do this especially specifically for the testing environment, which is often explicitly specified to Application's initializers instead of .detect() in unit tests. This behavior is only enabled when building in Xcode or with xcodebuild. This negates the need to explicitly override the input arguments in the non-production presets, meaning command line arguments no longer occasionally seem to vanish into thin air in certain cases.

    Redo the documentation comments for both versions of Environment.secret() and significantly simplify the implementation. Important : This is an interim cleanup step pending a complete revamp of the secret() API.

    Note : Pains have been taken not to change the observable behavior of any public APIs and to remain otherwise behaviorally consistent. The addition of VAPOR_ENV counts as new public API and thus drives this being a semver-minor change, but in all other respects it should have no visible effect.

  • v4.5.1 Changes

    May 06, 2020

    ๐Ÿš€ ###### This patch was authored and released by @tanner0101.

    ๐Ÿ›  Requests containing unrecognized session IDs will now result in a new session being created (#2347, fixes #2339).

    ๐Ÿ’ป This fixes a problem where clearing browser cookies would be required after changing Vapor's session driver.

  • v4.5.0 Changes

    May 01, 2020

    ๐Ÿš€ ###### This patch was authored by @calebkleveter and released by @tanner0101.

    โž• Adds app.routes.defaultMaxBodySize for configuring default maximum body size for streaming body collection (#2312).

    A ByteCount type has been added for easily expressing byte counts as strings like "1mb", "200GB", or "42 kb". This type is now usable where maximum body size integers were previously accepted (#2312).

    Vapor collects streaming bodies up to 16KB in size automatically before calling route closures. This makes it easier to decode content from requests since you can assume the entire request is already available in memory.

    To increase the maximum allowable size for streaming body collection, you can pass an arbitrary maxSize to the collect case of the body parameter in RouteBuilder.on.

    app.on(.POST, "upload", body: .collect(maxSize: "1mb")) { req in// Handle request. }
    

    ๐Ÿ“„ For more information on this API, visit https://docs.vapor.codes/4.0/routing/#body-streaming.

    0๏ธโƒฃ Now, in addition to setting this parameter for each route, you can change the global default Vapor uses.

    app.routes.defaultMaxBodySize = "10mb"
    

    0๏ธโƒฃ Route specific maximum size will always take precedence over the application default.

    Note: This maximum size only affects streaming request bodies. Non-streaming request bodies (request bodies that arrive in a single buffer from SwiftNIO) will not be subject to the maximum size restriction.

    ๐Ÿฑ โš ๏ธ Using .collect(maxSize: nil) will now result in the application's default maximum body size being used.

  • v4.4.1 Changes

    April 30, 2020

    ๐Ÿš€ ###### This patch was authored by @mcdappdev and released by @0xTim.

    ๐Ÿ“„ Replaces the use of threadPool.submit { _ in with threadPool.runIfActive as detailed in vapor/docs#478

  • v4.4.0 Changes

    April 21, 2020

    โž• Adds ability to configure the date encoding and decoding strategy for the URLEncodedFormDecoder and URLEncodedFormEncoder (#2273).

  • v4.3.1 Changes

    April 21, 2020

    ๐Ÿš€ ###### This patch was authored and released by @grosch.

    โšก๏ธ Updates HTTPMediaType equality checks so that the values are no longer case sensitive.

  • v4.3.0 Changes

    April 17, 2020

    ๐Ÿš€ ###### This patch was authored by @grosch and released by @tanner0101.

    โšก๏ธ Updates CORSMiddleware.Configuration's exposedHeaders parameter to accept [HTTPHeader.Name] instead of [String] like the other parameters do (#2314).

  • v4.2.1 Changes

    April 16, 2020

    ๐Ÿš€ ###### This patch was authored and released by @tanner0101.

    ๐Ÿ“œ HTTP header directive keys now support numbers. This fixes an issue with cookies not being parsed correctly when the key included a number in the name (#2317, fixes #2316).

  • v4.2.0 Changes

    April 15, 2020

    ๐Ÿš€ ###### This patch was authored by @grosch and released by @tanner0101.

    โž• Adds optional beforeEncode and afterDecode methods to Content protocol (#2267).

    ๐Ÿ“„ Docs: https://docs.vapor.codes/4.0/content/#hooks