Skip to content

Skip empty HTTPBody chunks in the URLSession stream bridge - #96

Open
Hashim1999164 wants to merge 1 commit into
apple:mainfrom
Hashim1999164:fix/empty-text-plain-body
Open

Skip empty HTTPBody chunks in the URLSession stream bridge#96
Hashim1999164 wants to merge 1 commit into
apple:mainfrom
Hashim1999164:fix/empty-text-plain-body

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Aug 13, 2026

Copy link
Copy Markdown

Fixes #85

An empty text/plain request body vends a zero length chunk. The output stream bridge then tried to write that chunk and hit a precondition. Maintainers agreed the transport should send an empty body.

Empty chunks are now skipped so the stream closes with a zero length body instead of crashing.

Test plan

Added testHTTPBodyOutputStreamEmptyChunkDoesNotCrash covering a single empty chunk. Built the OpenAPIURLSession product. Full XCTest suite needs Xcode.

@guoye-zhang guoye-zhang added the 🔨 semver/patch No public API change. label Aug 13, 2026
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.

Crash when sending empty text/plain request body (precondition(!bytesToWrite.isEmpty)) for generated client operation

2 participants