We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d93a914 commit a8d17f0Copy full SHA for a8d17f0
packages/qwik/src/optimizer/src/plugins/vite-server.ts
@@ -28,12 +28,9 @@ function getOrigin(req: IncomingMessage) {
28
}
29
30
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
+ if (!base || base === '/') {
+ // if base is empty or '/' and url it's safe to just return the url
33
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);
37
} else if (base && !base.endsWith('/') && !url.startsWith('/')) {
38
// if base doesn't end with '/' and url doesn't start with '/', add a '/' in between
39
base += '/';
0 commit comments