Skip to content

Add trailer support to URLSession backend#122

Open
guoye-zhang wants to merge 3 commits intoapple:mainfrom
guoye-zhang:urlsession-trailer
Open

Add trailer support to URLSession backend#122
guoye-zhang wants to merge 3 commits intoapple:mainfrom
guoye-zhang:urlsession-trailer

Conversation

@guoye-zhang
Copy link
Contributor

The old stack supports sending trailers on h1/h3, and receiving trailers on all HTTP versions. The new stack only supports receiving trailers, so we still need to make that work.

body: (consuming sending URLSessionTaskDelegateBridge) async throws(Failure) -> Return
) async throws(Failure) -> (Return, HTTPFields?) {
try await (body(self), nil)
try await (body(self), self.responseTrailerFields)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One of the reasons I think early returning before completing the read should throw is that we don't know whether nil means a trailer isn't present or it hasn't been received.

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.

1 participant