Skip to content

Commit

Permalink
Revert "land: Include charset=utf-8 with x-component Content-Type hea…
Browse files Browse the repository at this point in the history
…der" (vercel#50472)

This change isn't necessary per
vercel#50060 (comment) and
doesn't alleviate the root issue that was attempting to be addressed
instead that is related to a different issue upstream which is being
investigated.

Reverts vercel#50314
  • Loading branch information
ijjk authored and hydRAnger committed Jun 12, 2023
1 parent 4d5d4f9 commit 50ae754
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
3 changes: 1 addition & 2 deletions packages/next/src/client/components/app-router-headers.ts
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
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
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
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

0 comments on commit 50ae754

Please sign in to comment.