Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jan 7, 2025
1 parent 3c029f8 commit 53858bb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1239,12 +1239,6 @@ export default async function build(
pages404: true,
caseSensitive: !!config.experimental.caseSensitiveRoutes,
basePath: config.basePath,
streamingMetadataBotsUserAgent:
// Use the user configured UA regex if available, otherwise use the built-in default.
(
config.experimental.streamingMetadataBotsUserAgent ||
HEADLESS_BOT_UA_RE
).source,
redirects: redirects.map((r) =>
buildCustomRoute('redirect', r, restrictedRedirectPaths)
),
Expand Down Expand Up @@ -1274,6 +1268,12 @@ export default async function build(
},
}
: undefined,
streamingMetadataBotsUserAgent:
// Use the user configured UA regex if available, otherwise use the built-in default.
(
config.experimental.streamingMetadataBotsUserAgent ||
HEADLESS_BOT_UA_RE
).source,
} satisfies RoutesManifest
})

Expand Down
2 changes: 2 additions & 0 deletions test/integration/custom-routes/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2564,6 +2564,8 @@ const runTests = (isDev = false) => {
prefetchSuffix: '.prefetch.rsc',
suffix: '.rsc',
},
streamingMetadataBotsUserAgent:
'Googlebot|Google-PageRenderer|AdsBot-Google|googleweblight|Storebot-Google',
})
})

Expand Down
2 changes: 2 additions & 0 deletions test/integration/dynamic-routing/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,8 @@ function runTests({ dev }) {
prefetchSuffix: '.prefetch.rsc',
suffix: '.rsc',
},
streamingMetadataBotsUserAgent:
'Googlebot|Google-PageRenderer|AdsBot-Google|googleweblight|Storebot-Google',
})
})

Expand Down

0 comments on commit 53858bb

Please sign in to comment.