diff --git a/adapters/shared/vite/index.cjs b/adapters/shared/vite/index.cjs index fb480f3..1d12ace 100644 --- a/adapters/shared/vite/index.cjs +++ b/adapters/shared/vite/index.cjs @@ -270,9 +270,12 @@ function viteAdapter(opts) { if (!ssgOrigin) { ssgOrigin = `https://yoursite.qwik.dev`; } - if (ssgOrigin.length > 0 && !ssgOrigin.startsWith("https://") && !ssgOrigin.startsWith("http://")) { + if (ssgOrigin.length > 0 && !/:\/\//.test(ssgOrigin)) { ssgOrigin = `https://${ssgOrigin}`; } + if (ssgOrigin.startsWith("//")) { + ssgOrigin = `https:${ssgOrigin}`; + } try { ssgOrigin = new URL(ssgOrigin).origin; } catch (e) { diff --git a/adapters/shared/vite/index.mjs b/adapters/shared/vite/index.mjs index b319849..b3b3440 100644 --- a/adapters/shared/vite/index.mjs +++ b/adapters/shared/vite/index.mjs @@ -231,9 +231,12 @@ function viteAdapter(opts) { if (!ssgOrigin) { ssgOrigin = `https://yoursite.qwik.dev`; } - if (ssgOrigin.length > 0 && !ssgOrigin.startsWith("https://") && !ssgOrigin.startsWith("http://")) { + if (ssgOrigin.length > 0 && !/:\/\//.test(ssgOrigin)) { ssgOrigin = `https://${ssgOrigin}`; } + if (ssgOrigin.startsWith("//")) { + ssgOrigin = `https:${ssgOrigin}`; + } try { ssgOrigin = new URL(ssgOrigin).origin; } catch (e) { diff --git a/adapters/static/vite/index.cjs b/adapters/static/vite/index.cjs index 96637a0..d72fa9b 100644 --- a/adapters/static/vite/index.cjs +++ b/adapters/static/vite/index.cjs @@ -267,9 +267,12 @@ function viteAdapter(opts) { if (!ssgOrigin) { ssgOrigin = `https://yoursite.qwik.dev`; } - if (ssgOrigin.length > 0 && !ssgOrigin.startsWith("https://") && !ssgOrigin.startsWith("http://")) { + if (ssgOrigin.length > 0 && !/:\/\//.test(ssgOrigin)) { ssgOrigin = `https://${ssgOrigin}`; } + if (ssgOrigin.startsWith("//")) { + ssgOrigin = `https:${ssgOrigin}`; + } try { ssgOrigin = new URL(ssgOrigin).origin; } catch (e) { diff --git a/adapters/static/vite/index.mjs b/adapters/static/vite/index.mjs index f1b44ef..59e1af3 100644 --- a/adapters/static/vite/index.mjs +++ b/adapters/static/vite/index.mjs @@ -231,9 +231,12 @@ function viteAdapter(opts) { if (!ssgOrigin) { ssgOrigin = `https://yoursite.qwik.dev`; } - if (ssgOrigin.length > 0 && !ssgOrigin.startsWith("https://") && !ssgOrigin.startsWith("http://")) { + if (ssgOrigin.length > 0 && !/:\/\//.test(ssgOrigin)) { ssgOrigin = `https://${ssgOrigin}`; } + if (ssgOrigin.startsWith("//")) { + ssgOrigin = `https:${ssgOrigin}`; + } try { ssgOrigin = new URL(ssgOrigin).origin; } catch (e) { diff --git a/package.json b/package.json index 486df3d..35715bb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@builder.io/qwik-city", "description": "The meta-framework for Qwik.", - "version": "1.5.1-dev20240327213705", + "version": "1.5.1-dev20240330092334", "bugs": "https://github.com/BuilderIO/qwik/issues", "dependencies": { "@mdx-js/mdx": "^3.0.1",