Skip to content

Commit 4651e6a

Browse files
fix(remix-dev/vite): validate server bundle IDs (#8598)
1 parent 656aa29 commit 4651e6a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/remix-dev/vite/build.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ async function getServerBuilds(ctx: RemixPluginContext): Promise<{
155155
if (typeof serverBundleId !== "string") {
156156
throw new Error(`The "serverBundles" function must return a string`);
157157
}
158+
if (!/^[a-zA-Z0-9-_]+$/.test(serverBundleId)) {
159+
throw new Error(
160+
`The "serverBundles" function must only return strings containing alphanumeric characters, hyphens and underscores.`
161+
);
162+
}
158163
buildManifest.routeIdToServerBundleId[route.id] = serverBundleId;
159164

160165
let relativeServerBundleDirectory = path.relative(

0 commit comments

Comments
 (0)