Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response content length #129

Merged
merged 1 commit into from
Nov 7, 2024
Merged

Conversation

ben-krieger
Copy link
Contributor

@ben-krieger ben-krieger commented Oct 31, 2024

What

When HTTP response from Go contains Content-Length header, then the Cloudflare response will also contain Content-Length and not use Transfer-Encoding: chunked.

Motivation

Transfer encoding ideally shouldn't change from the Go server. In my case, my client can't handle chunked responses.

@ben-krieger ben-krieger marked this pull request as ready for review November 7, 2024 16:23
Uint8ArrayClass = js.Global().Get("Uint8Array")
ErrorClass = js.Global().Get("Error")
ReadableStreamClass = js.Global().Get("ReadableStream")
FixedLengthStreamClass = js.Global().Get("FixedLengthStream")
Copy link
Owner

Choose a reason for hiding this comment

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

FixedLengthStream is an original feature of Cloudflare.

So once we start supporting another runtime (such as Deno), we need to check its existence.
However, since syumai/workers currently only supports Cloudflare Workers, it's OK.

Copy link
Owner

@syumai syumai left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@syumai syumai merged commit 8784539 into syumai:main Nov 7, 2024
2 checks passed
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