Skip to content

Handle request stream ending before receiving request end#54

Merged
aryan-25 merged 2 commits intoswift-server:mainfrom
aryan-25:fix-error-case
Feb 6, 2026
Merged

Handle request stream ending before receiving request end#54
aryan-25 merged 2 commits intoswift-server:mainfrom
aryan-25:fix-error-case

Conversation

@aryan-25
Copy link
Collaborator

@aryan-25 aryan-25 commented Feb 6, 2026

Motivation:

In #44, we introduced a fatalError in HTTPRequestConcludingAsyncReader when the request stream ends before the request end part is received. This is incorrect behaviour, and the server should not fatal error in this scenario.

Modifications:

Replaced the fatalError with a throw.

Result:

The server no longer fatal errors when the request stream ends before the request end part is received.

Motivation:

In swift-server#44, we introduced a `fatalError` in the case where the request stream ends before the request end part is received. The server should not fatalError in this scenario.

Modifications:
Replaced the `fatalError` in the scenario with a `throw`.

Result:
The server no longer fatal errors when the request stream ends before the request end part is received.
@aryan-25 aryan-25 added the 🔨 semver/patch No public API change. label Feb 6, 2026
@aryan-25 aryan-25 merged commit 6c83ee3 into swift-server:main Feb 6, 2026
25 of 27 checks passed
@aryan-25 aryan-25 deleted the fix-error-case branch February 6, 2026 16:44
@Lukasa
Copy link
Collaborator

Lukasa commented Feb 11, 2026

NB for the future: we should be adding regression tests when we fix things like this.

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