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

Revert "land: Include charset=utf-8 with x-component Content-Type header" #50472

Merged
merged 1 commit into from
May 29, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/next/src/client/components/app-router-headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export const NEXT_ROUTER_STATE_TREE = 'Next-Router-State-Tree' as const
export const NEXT_ROUTER_PREFETCH = 'Next-Router-Prefetch' as const
export const NEXT_URL = 'Next-Url' as const
export const FETCH_CACHE_HEADER = 'x-vercel-sc-headers' as const
export const RSC_CONTENT_TYPE_HEADER =
'text/x-component; charset=utf-8' as const
export const RSC_CONTENT_TYPE_HEADER = 'text/x-component' as const
export const RSC_VARY_HEADER =
`${RSC}, ${NEXT_ROUTER_STATE_TREE}, ${NEXT_ROUTER_PREFETCH}` as const

Expand Down
12 changes: 4 additions & 8 deletions test/e2e/app-dir/app/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,26 +227,22 @@ createNextDescribe(
})
}

it('should use text/x-component; charset=utf-8 for flight', async () => {
it('should use text/x-component for flight', async () => {
const res = await next.fetch('/dashboard/deployments/123', {
headers: {
['RSC'.toString()]: '1',
},
})
expect(res.headers.get('Content-Type')).toBe(
'text/x-component; charset=utf-8'
)
expect(res.headers.get('Content-Type')).toBe('text/x-component')
})

it('should use text/x-component; charset=utf-8 for flight with edge runtime', async () => {
it('should use text/x-component for flight with edge runtime', async () => {
const res = await next.fetch('/dashboard', {
headers: {
['RSC'.toString()]: '1',
},
})
expect(res.headers.get('Content-Type')).toBe(
'text/x-component; charset=utf-8'
)
expect(res.headers.get('Content-Type')).toBe('text/x-component')
})

it('should return the `vary` header from edge runtime', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/custom-routes/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2586,7 +2586,7 @@ const runTests = (isDev = false, isTurbo = false) => {
],
rsc: {
header: 'RSC',
contentTypeHeader: 'text/x-component; charset=utf-8',
contentTypeHeader: 'text/x-component',
varyHeader: 'RSC, Next-Router-State-Tree, Next-Router-Prefetch',
},
})
Expand Down
2 changes: 1 addition & 1 deletion test/integration/dynamic-routing/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ function runTests({ dev }) {
],
rsc: {
header: 'RSC',
contentTypeHeader: 'text/x-component; charset=utf-8',
contentTypeHeader: 'text/x-component',
varyHeader: 'RSC, Next-Router-State-Tree, Next-Router-Prefetch',
},
})
Expand Down