Skip to content

Commit

Permalink
dc87b86 fix: custom origin protocol (#6070)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickJS committed Mar 30, 2024
1 parent a505aa4 commit c6ac291
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
5 changes: 4 additions & 1 deletion adapters/shared/vite/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion adapters/shared/vite/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion adapters/static/vite/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion adapters/static/vite/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit c6ac291

Please sign in to comment.