Skip to content

test: Add failing Request + expectedLength tests to workerd/api/tests/streams-test.js - #4418

Closed
kitten wants to merge 1 commit into
cloudflare:mainfrom
kitten:@kitten/test/failing-request-expected-length
Closed

kitten wants to merge 1 commit into
cloudflare:mainfrom
kitten:@kitten/test/failing-request-expected-length

Conversation

@kitten

@kitten kitten commented Jun 27, 2025

Copy link
Copy Markdown
Contributor

As per the existing tests we'd expect the Content-Length to be adopted from the input stream even when a fetch request is made with body set to a fixed-length stream.

This follows from:

  • fd4fc75
  • KJ_IF_SOME(l, requestBody.tryGetLength()) {
    jsHeaders->setUnguarded(
    js, js.accountedByteString("Content-Length"_kj), js.accountedByteString(kj::str(l)));
    } else {
    jsHeaders->setUnguarded(
    js, js.accountedByteString("Transfer-Encoding"_kj), js.accountedByteString("chunked"_kj));
    }

However, when new Request is used, the original size of the stream is lost.

@kitten
kitten requested review from a team as code owners June 27, 2025 14:25
@github-actions

github-actions Bot commented Jun 27, 2025 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@kitten

kitten commented Jun 27, 2025

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 27, 2025
@kitten
kitten force-pushed the @kitten/test/failing-request-expected-length branch from a2142f2 to 3a6e430 Compare September 17, 2025 10:43
@kitten

kitten commented Sep 17, 2025

Copy link
Copy Markdown
Contributor Author

Rebased, but assuming this is still an issue. Haven't rechecked this locally yet though

@bartlomieju

Copy link
Copy Markdown
Collaborator

Looks like this was done in #5115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants