Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from vapor:master #285

Open
wants to merge 92 commits into
base: master
Choose a base branch
from
Open

[pull] master from vapor:master #285

wants to merge 92 commits into from

Conversation

pull[bot]
Copy link

@pull pull bot commented Jun 16, 2020

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

tanner0101 and others added 3 commits June 10, 2020 11:28
* make Abort debuggable

* named funcs

* cleanup ci names

* implement CBacktrace linux support
@pull pull bot added the ⤵️ pull label Jun 16, 2020
tanner0101 and others added 26 commits June 23, 2020 14:37
* update for xcode 12

* use (#file) instead
## Current behaviour

`[ INFO ] GET /users/auth0%7C59abc/`

## Expected behaviour

`[ INFO ] GET /users/auth0|59abc/`

Co-authored-by: Jari (LotU) <j.koopman@jarict.nl>
* Add validation tests for optional nested objects

* Improve nested validator to follow the required argument

Co-authored-by: seeppp <jonas.schoch@naptics.ch>
Co-authored-by: Joannis Orlandos <joannis@orlandos.nl>
Co-authored-by: Jari (LotU) <j.koopman@jarict.nl>
* echo server

* warning

* fix tests

* drain unhandled request after response end

* rm commented code

* add handler tests

* test EOF framing, fixes #2391

* test incorrect response body stream count, fixes #2392

* http fixes
* Update RoutesCommand to align with RoutingKit

* Simplify the implementation

* Move consoleText() conversion to PathComponent

Co-authored-by: Tanner <tannernelson@gmail.com>
* * Adds Application.Routes.caseInsensitive to allow case insensitive routes (defaults to false)
* DefaultResponder will configure TrieRouter appropriately if set to true
* Appropriate test

* Docblock

Co-authored-by: Tanner <tannernelson@gmail.com>
* add information about writing release notes

* updates
* logging improvements

* fix error test expectations

* stacktrace capture
* immediate body streaming

* fix echo handler expectations
* add vapor 3 api shims

* fix trailing whitespace

* deprecate expectation alias

* deprecate expectation alias
* Supports closure for instantiating RedirectMiddleware

* Path closure now gives the entire request

* Clean up code

* Updates documentation comment to reflect latest changes

* Added RedirectMiddleware test

* use `makePath` naming

Co-authored-by: Tanner <me@tanner.xyz>
Co-authored-by: Tanner <tannernelson@gmail.com>
* Fix for decoding percent escaped query keys (#2383) (#2384)

* remove constant variables

* parser cleanup

Co-authored-by: Dale Buckley <dalebuckley86@gmail.com>
* add github action

* Update api-docs.yml

* Update api-docs.yml

* Update api-docs.yml

* Update api-docs.yml

* Update api-docs.yml

* Update api-docs.yml

Co-authored-by: Tanner <tannernelson@gmail.com>
* add provider tests to ci

* fix provider tests

* updates

* fix
* Provide a way to customize bootstrapping of the logging system

* Introduce a new `bootstrap()` method that takes a closure that creates
  a LogHandler factory, a factory-factory!

* Make the current `bootstrap()` method call into the new one.

The point of this maneuver is to allow for installing custom log handlers
while retaining Vapor's procedure for setting the log level.

* Rename the label of the factory argument

Also add missing `self.`.

* Move log level detection to public method on Logger.Level

This move makes it possible to detect the desired log level the same
way Vapor does when bootstrapping the LoggingSystem.

Co-authored-by: Johan Carlberg <48096080+johan-carlberg@users.noreply.github.com>
* Add non-variadic variants of RoutesBuilder group methods.

* Apply suggestions from code review
* Add require(_:error:) extension to Parameters.

* Address PR feedback.

* Throw error if type cast fails.

* Address PR feedback.

* Update docs.
gwynne and others added 28 commits October 29, 2020 03:33
* Dont run so many provider checks, just the latest Swift is fine. Should make the CI repo define what "latest" is.
* Add failing test for #2518

* Extract Date-Decoding into an extension

* Use configuration for decoding of optional Dates (fixes #2518)

* Extract Date-encoding into an extension

* Use configuration for encoding of optional Dates

* Update Formatting in URLEncodedFormDecoder.swift

Co-authored-by: Siemen Sikkema <siemensikkema@users.noreply.github.com>

* Update test name

Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>

Co-authored-by: Andreas Tielmann <atielmann@deloitte.de>
Co-authored-by: Siemen Sikkema <siemensikkema@users.noreply.github.com>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
…ate middleware, enabled by default, so that users who don't want it can turn it off. Also fixes a copy-paste error in a fatal error message. (#2521)
As reported by #2480, right now `SessionData` is a public type without much use to developers to write middleware, algorithms, etc. on top of due to how strongly the storage is encapsulated.

`SessionData` has been changed as follows:

- Now conforms to `Equatable` and `ExpressibleByDictionaryLiteral`
- A new `snapshot` computed property is available to get a copy of its storage
- `init(_:)` is now deprecated in favor of `init(initialData:)`

```swift
let data: SessionData = ["name": "Vapor"]
// creates a copy of the data as of this point
let snapshot = data.snapshot
client.storeUsingDictionary(snapshot)
```
* still return cookies if some fail to parse values, and accept % in directive name

* added tests for cookie parsing
…there is no trailling new line (#2523)

Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
* Allow custom media types for FileIO.streamFile

2nd squash

* Use HTTP Range & HTTP Content Range headers for streaming partial content

* Update Sources/Vapor/HTTP/Headers/HTTPHeaders+ContentRange.swift

Co-authored-by: Siemen Sikkema <siemensikkema@users.noreply.github.com>

* Update Sources/Vapor/Utilities/FileIO.swift

Co-authored-by: Siemen Sikkema <siemensikkema@users.noreply.github.com>

* Update Sources/Vapor/Utilities/FileIO.swift

Co-authored-by: Siemen Sikkema <siemensikkema@users.noreply.github.com>

* Update Sources/Vapor/HTTP/Headers/HTTPHeaders+ContentRange.swift

Co-authored-by: Siemen Sikkema <siemensikkema@users.noreply.github.com>

* Update Sources/Vapor/HTTP/Headers/HTTPHeaders+ContentRange.swift

Co-authored-by: Siemen Sikkema <siemensikkema@users.noreply.github.com>

* Update Sources/Vapor/HTTP/Headers/HTTPHeaders+ContentRange.swift

Co-authored-by: Siemen Sikkema <siemensikkema@users.noreply.github.com>

* Make the compiler happy

* Add better bounds checking to range count

* More bounds checking

Co-authored-by: Tanner <tannernelson@gmail.com>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
Co-authored-by: Siemen Sikkema <siemensikkema@users.noreply.github.com>
Co-authored-by: Tim <0xtimc@gmail.com>
* Add code to avoid crash + test

* Add missing part

* Apply suggestions from code review

Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>

Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
* remove unnecessary files and link to multipart-kit

* update to multipart-kit beta

* update multipart-kit to latest tag
…inBased (#2559)

Motivation:

Mozilla's [CORS docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin) have

> To allow any site to make CORS requests without using the * wildcard
> (for example, to enable credentials), your server must read the value of
> the request's Origin header and use that value to set
> Access-Control-Allow-Origin, and must also set a Vary: Origin header to
> indicate that some headers are being set dynamically depending on the
> origin.

but previously, we wouldn't set the Vary: Origin header.

Modification:

Set the "vary: origin" header when using the request's "origin" header.

Result:

More correct implementation of CORS.
Co-authored-by: Owain Hunt <owain.hunt@johnlewis.co.uk>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
* Start backfilling some tests for metrics

* Add failing test for not found route

* Rewrite 404 path to avoid DOS attack

* Failing test to distinguish between undefined routes and routes that return a 404

* Finalise path expressions

* Don't crash the tests by bootstrapping multiple times

* Tests passing

* Make tests non-throwing

* Check request.route instead of adding new bool

* Update Tests/VaporTests/Utilities/CapturingMetricsSystem.swift

Co-authored-by: Gwynne Raskind <gwynne@darkrainfall.org>

* Add attribution for CapturingMetricsSystem

* Update Tests/VaporTests/Utilities/CapturingMetricsSystem.swift

Co-authored-by: Gwynne Raskind <gwynne@darkrainfall.org>

* Remove last uses of NSUUID

* Revert change to stop the tests crashing

* Backfill more tests

* Migrate CapturingMetricsSystem to NIOConcurrencyHelpers

* Ensure undefined route methods get mapped to undefined

* Add tests for the timers as well

* Reuse dimensions for the timer as well

* Rewrite undefined routes' method to undefined as well as the path

* Avoid duplicating the method in the path

* Add comment for rewriting path in metrics

* Add test to ensure we don't pass through the ID for a dynamic path

* Fix typo in comment

Co-authored-by: Gwynne Raskind <gwynne@darkrainfall.org>
…shared` accessor (#2576)

The storage is a Dictionary and can potentially be mutated by one thread while being accessed from another which isn't holding the lock. This is not safe, even if the logic checks again after taking the lock. Unfortunately, this is likely to be a relatively obvious performance regression, but it's also a definitive thread safety concern.
* Update to logo with name

* Use cropped logo
* Improve cookie parsing test

* Strictly conform to RFC2616

* Add invalid cookie test cases

* Remove unnecessary vars

* Fix comment typo

* Restore test case

Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
@gwynne gwynne deleted the branch scope-demo:master March 12, 2021 02:50
@gwynne gwynne deleted the master branch March 12, 2021 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⤵️ pull merge-conflict Resolve conflicts manually
Projects
None yet