Skip to content

Conversation

dnadoba
Copy link
Collaborator

@dnadoba dnadoba commented Dec 2, 2021

Before we can execute a HTTPClientRequest we need do a couple of validation and transformation steps which can fail.
The result of the preparation is now encapsulated in a separate object called HTTPClientRequest.Prepared.

@dnadoba dnadoba added the 🔨 semver/patch No public API change. label Dec 2, 2021
@dnadoba dnadoba requested a review from fabianfett December 2, 2021 19:28
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. However we should add tests with a follow up PR.

Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One note about API changes, otherwise this looks good.


@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
extension HTTPClientRequest {
func prepared() throws -> Prepared {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd rather write this as an init on Prepared, if that's ok.

@dnadoba dnadoba merged commit 5ce7377 into swift-server:main Dec 3, 2021
@dnadoba dnadoba deleted the dn-prepared branch December 3, 2021 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants