Revert "fix: Always use IP address for webhooks"

This reverts commit 880865f1f2.
This commit is contained in:
Andras Bacsai
2022-04-29 23:25:15 +02:00
parent 45c904e876
commit e93d97f2bc
6 changed files with 16 additions and 39 deletions

View File

@@ -1,5 +1,3 @@
import { dev } from '$app/env';
export const asyncSleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
export const dateOptions: DateTimeFormatOptions = {
year: 'numeric',
@@ -23,18 +21,6 @@ export const staticDeployments = [
];
export const notNodeDeployments = ['php', 'docker', 'rust', 'python', 'deno', 'laravel'];
export async function getIP() {
if (dev) {
return 'localhost:3000';
}
const response = await fetch(`https://api.ipify.org?format=json`);
if (response.ok) {
const json = await response.json();
return `http://${json.ip}`;
}
return window.location.origin;
}
export function getDomain(domain) {
return domain?.replace('https://', '').replace('http://', '');
}