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

Changelog History
Page 3

  • v4.26.1 Changes

    July 21, 2020

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

    ๐Ÿ›  Fixes an array out of bounds error in StackTrace.description(max:) (#2447).

  • v4.26.0 Changes

    July 20, 2020

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

    โž• Adds a webSocket route overload that accepts an array instead of variadic path (#2445, #2434).

    app.webSocket(["foo", "bar"]) { req, ws in// Handle WebSocket client.}
    
  • v4.25.0 Changes

    July 17, 2020

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

    ๐Ÿ›  Fix misspelled property name of class Routes, change from caseInsenstive to caseInsensitive (#2435, fixes #2426).

    ๐Ÿ—„ The misspelled caseInsenstive is now marked as deprecated.

  • v4.24.0 Changes

    July 17, 2020

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

    โž• Adds writeFile method to request's FileIO helper (#2418).

    // Writes "hello" to /path/to/file.txt// Returns a future indicating when the write has completed. req.fileio.writeFile(.init(string: "hello"), at: "/path/to/file.txt")
    
  • v4.23.0 Changes

    July 16, 2020

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

    Enables call sites that use URIs to allow for string literals that make use of interpolation (#2442).

    app.get("hello") { req -\> EventLoopFuture\<String\> inreturn req.client.get("\(Constants.basePath)/status") .flatMapThrowing { res throws inreturn "Hello, world!" } }
    
  • v4.22.0 Changes

    July 16, 2020

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

    โž• Adds validate(query:) method to Validatable protocol for validating decoded query parameters (#2419).

    Previously, you could only validate the content that came from the request body. Now, this addition allows for validating decoded query parameters that conform to the Content protocol.

    struct Hello: Content, Validatable { name: String?static func validations(\_ validations: inout Validations) { validations.add("name", as: String.self, is: .alphanumeric) } }
    

    And the following URL, http://localhost:8080/model?name=Vapor, you can now validate the query parameter "name" as follows:

    try Hello.validate(query: request)let hello = try req.query.decode(Hello.self)
    

    The existing content validation method validate(_:) has been renamed to validate(content:) to reduce ambiguity.

    try Hello.validate(content: request)let hello = try req.content.decode(Hello.self)
    
  • v4.10.0 Changes

    June 15, 2020

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

    Abort now conforms to DebuggableError (#2400).

    Abort now exposes source, reason, identifier, and stackTrace via the DebuggableError protocol.

    ๐Ÿฑ โš ๏ธ Abort.source is now an optional as required by DebuggableError.

    0๏ธโƒฃ Abort now captures StackTrace by default.

    func foo() throws { try bar() }func bar() throws { try baz() }func baz() throws { throw Abort(.internalServerError, reason: "Oops") }do { try foo() } catch let error as DebuggableError { XCTAssertContains(error.stackTrace?.frames[0].function, "baz") XCTAssertContains(error.stackTrace?.frames[1].function, "bar") XCTAssertContains(error.stackTrace?.frames[2].function, "foo") }
    

    To avoid capturing a stack trace, pass nil:

    Abort(.internalServerError, reason: "Oops", stackTrace: nil)
    

    To disable stack traces globally, use:

    StackTrace.isCaptureEnabled = false
    

    ๐Ÿ‘Œ Improved StackTrace.capture on Linux (#2400).

    ๐Ÿง StackTrace.capture on Linux now utilizes libbacktrace to provide symbol names.

    0 VaporTests baz #1 () throws -> () in VaporTests.ErrorTests.testAbortDebuggable() throws -> ()
    1 VaporTests bar #1 () throws -> () in VaporTests.ErrorTests.testAbortDebuggable() throws -> ()
    2 VaporTests foo #1 () throws -> () in VaporTests.ErrorTests.testAbortDebuggable() throws -> ()
    3 VaporTests VaporTests.ErrorTests.testAbortDebuggable() throws -> ()
    ...
    

    StackFrame.capture now accepts an optional skip parameter. Use this to exclude any extraneous stack frames from the captured result.

    // Captures stack trace, excluding this init call.init(stackTrace: StackTrace? = .capture(skip: 1)) { ...}
    
  • v4.9.0 Changes

    June 13, 2020

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

    ๐Ÿ“‡ Renames CORSMiddleware.AllowOriginSetting's list of allowable origins case to .any (#2397).

  • v4.8.0 Changes

    June 01, 2020

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

    ๐Ÿ‘ Up until right now, the .count(...) and .range(...) validators didn't support being passed a PartialRangeUpTo. This commit adds support for this.

    ๐Ÿ“š This also improves and fixes documentation

  • v4.7.1 Changes

    May 28, 2020

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

    โž• Adds support for . in HTTP header value directive keys, like cookie names (#2372, fixes #2359).