Skip to content

Commit a8d17f0

Browse files
authored
Update vite-server.ts
1 parent d93a914 commit a8d17f0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/qwik/src/optimizer/src/plugins/vite-server.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ function getOrigin(req: IncomingMessage) {
2828
}
2929

3030
function validateAndMerge(base: string, url: string) {
31-
if (!base && !url.startsWith('/')) {
32-
// if base is empty and url doesn't start with '/', it's safe to just return the url
31+
if (!base || base === '/') {
32+
// if base is empty or '/' and url it's safe to just return the url
3333
return url;
34-
} else if (!base && url.startsWith('/')) {
35-
// if base is empty and url does start with '/', remove the starting '/' from url
36-
return url.slice(1);
3734
} else if (base && !base.endsWith('/') && !url.startsWith('/')) {
3835
// if base doesn't end with '/' and url doesn't start with '/', add a '/' in between
3936
base += '/';

0 commit comments

Comments
 (0)