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.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 thebody.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 bothVAPOR_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 thetesting
environment, which is often explicitly specified toApplication
's initializers instead of.detect()
in unit tests. This behavior is only enabled when building in Xcode or withxcodebuild
. 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 thesecret()
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 asemver-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 thecollect
case of thebody
parameter inRouteBuilder.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
withthreadPool.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
andURLEncodedFormEncoder
(#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
'sexposedHeaders
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
andafterDecode
methods toContent
protocol (#2267).๐ Docs: https://docs.vapor.codes/4.0/content/#hooks