Skip to content

Commit f73e0c6

Browse files
committed
fix: remove check against unresolved id
1 parent 9df604b commit f73e0c6

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

packages/vite/src/node/server/middlewares/transform.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import { checkServingAccess, respondWithAccessDenied } from './static'
4343
const debugCache = createDebugger('vite:cache')
4444

4545
const knownIgnoreList = new Set(['/', '/favicon.ico'])
46-
const trailingQuerySeparatorsRE = /[?&]+$/
4746

4847
// TODO: consolidate this regex pattern with the url, raw, and inline checks in plugins
4948
const urlRE = /[?&]url\b/
@@ -208,22 +207,6 @@ export function transformMiddleware(
208207
warnAboutExplicitPublicPathInUrl(url)
209208
}
210209

211-
const urlWithoutTrailingQuerySeparators = url.replace(
212-
trailingQuerySeparatorsRE,
213-
'',
214-
)
215-
if (
216-
!url.startsWith('/@id/\0') &&
217-
deniedServingAccessForTransform(
218-
urlWithoutTrailingQuerySeparators,
219-
server,
220-
res,
221-
next,
222-
)
223-
) {
224-
return
225-
}
226-
227210
if (
228211
req.headers['sec-fetch-dest'] === 'script' ||
229212
isJSRequest(url) ||

playground/fs-serve/__tests__/fs-serve.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ describe.runIf(isServe)('main', () => {
208208
.poll(() =>
209209
page.textContent('.unsafe-fs-fetch-relative-path-after-query-status'),
210210
)
211-
.toBe('403')
211+
.toBe('404')
212212
})
213213

214214
test('nested entry', async () => {

0 commit comments

Comments
 (0)