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

Remove explicit Transfer-Encoding: chunked header #4807

Merged
merged 2 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sweet-ligers-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Remove explicit `Transfer-Encoding: chunked` header from streaming responses
1 change: 0 additions & 1 deletion packages/astro/src/core/render/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ export async function render(opts: RenderOptions): Promise<Response> {
site,
scripts,
ssr,
streaming,
status,
});

Expand Down
8 changes: 1 addition & 7 deletions packages/astro/src/core/render/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ function onlyAvailableInSSR(name: string) {
export interface CreateResultArgs {
adapterName: string | undefined;
ssr: boolean;
streaming: boolean;
logging: LogOptions;
origin: string;
markdown: MarkdownRenderingOptions;
Expand Down Expand Up @@ -126,12 +125,7 @@ export function createResult(args: CreateResultArgs): SSRResult {

const url = new URL(request.url);
const headers = new Headers();
if (args.streaming) {
headers.set('Transfer-Encoding', 'chunked');
headers.set('Content-Type', 'text/html');
} else {
headers.set('Content-Type', 'text/html');
}
headers.set('Content-Type', 'text/html');
const response: ResponseInit = {
status: args.status,
statusText: 'OK',
Expand Down