File tree 1 file changed +2
-2
lines changed
packages/vite/src/node/server/middlewares
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ export function serveStaticMiddleware(
101
101
return next ( )
102
102
}
103
103
104
- const url = new URL ( req . url ! . replace ( / ^ \/ + / , '/' ) , 'http://example.com' )
104
+ const url = new URL ( req . url ! . replace ( / ^ \/ { 2 , } / , '/' ) , 'http://example.com' )
105
105
const pathname = decodeURI ( url . pathname )
106
106
107
107
// apply aliases to static requests as well
@@ -154,7 +154,7 @@ export function serveRawFsMiddleware(
154
154
155
155
// Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
156
156
return function viteServeRawFsMiddleware ( req , res , next ) {
157
- const url = new URL ( req . url ! . replace ( / ^ \/ + / , '/' ) , 'http://example.com' )
157
+ const url = new URL ( req . url ! . replace ( / ^ \/ { 2 , } / , '/' ) , 'http://example.com' )
158
158
// In some cases (e.g. linked monorepos) files outside of root will
159
159
// reference assets that are also out of served root. In such cases
160
160
// the paths are rewritten to `/@fs/` prefixed paths and must be served by
You can’t perform that action at this time.
0 commit comments