From 0265d8520217a38987e00d10afc488580ae02fee Mon Sep 17 00:00:00 2001 From: Loudbook Date: Sat, 11 Jan 2025 21:45:22 -0500 Subject: [PATCH] Support numerical local IP --- backend/src/delete_service.rs | 1 - frontend/src/components/new/Submit.svelte | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/delete_service.rs b/backend/src/delete_service.rs index 44f5863..fefca34 100644 --- a/backend/src/delete_service.rs +++ b/backend/src/delete_service.rs @@ -84,7 +84,6 @@ impl DeleteHandler { } } } - Ok(()) } } diff --git a/frontend/src/components/new/Submit.svelte b/frontend/src/components/new/Submit.svelte index bd7661b..2a259a6 100755 --- a/frontend/src/components/new/Submit.svelte +++ b/frontend/src/components/new/Submit.svelte @@ -45,7 +45,7 @@ let domain = window.location.host; - if (domain.includes("localhost")) { + if (domain.includes("localhost") || domain.match(/192\.168\.\d+\.\d+/)) { xhr.open("POST", `http://localhost:8080/upload`); } else { xhr.open("POST", `https://api.${domain}/upload`);