fix: rsc headers (#31854)

`headers` type should align with `NodeHeaders`
This commit is contained in:
Jiachi Liu 2021-11-26 19:04:36 +01:00 committed by GitHub
parent 112ca407c0
commit cf64e9130e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 8 deletions

View file

@ -1,6 +1,7 @@
import { NextRequest } from '../../../../server/web/spec-extension/request'
import { renderToHTML } from '../../../../server/web/render'
import RenderResult from '../../../../server/render-result'
import { toNodeHeaders } from '../../../../server/web/utils'
const createHeaders = (args?: any) => ({
...args,
@ -49,7 +50,7 @@ export function getRender({
const req = {
url: pathname,
cookies,
headers,
headers: toNodeHeaders(headers),
}
const renderOpts = {
...restRenderOpts,

View file

@ -19,7 +19,7 @@ export default function Index({ header, router }) {
export function getServerSideProps({ req }) {
const { headers } = req
const header = headers.get(headerKey)
const header = headers[headerKey]
return {
props: {

View file

@ -19981,16 +19981,11 @@ webpack-bundle-analyzer@4.3.0:
source-list-map "^2.0.0"
source-map "~0.6.1"
"webpack-sources3@npm:webpack-sources@3.2.2":
"webpack-sources3@npm:webpack-sources@3.2.2", webpack-sources@^3.2.0, webpack-sources@^3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.2.tgz#d88e3741833efec57c4c789b6010db9977545260"
integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw==
webpack-sources@^3.2.2:
version "3.2.2"
resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.2.tgz#d88e3741833efec57c4c789b6010db9977545260"
integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw==
"webpack4@npm:webpack@4.44.1":
version "4.44.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.44.1.tgz#17e69fff9f321b8f117d1fda714edfc0b939cc21"