From 6f77632c2761ade8b235654c827e664ebd01e215 Mon Sep 17 00:00:00 2001 From: Alex / Awex Date: Thu, 15 Jul 2021 11:23:44 -0400 Subject: [PATCH] updated ss script again --- assets/js/screenshot.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/js/screenshot.js b/assets/js/screenshot.js index 527b910..f048006 100644 --- a/assets/js/screenshot.js +++ b/assets/js/screenshot.js @@ -1,12 +1,13 @@ async function getFileUrl() { const params = new URLSearchParams(window.location.search) let title = params.get('photo') - let apiurl = `https://${window.location.host}/screenshots?title=${title}` - let pageURL = `https://${window.location.host}/view?photo=${title}` + let apiurl = `http://${window.location.host}/screenshots?title=${title}` + let pageURL = `http://${window.location.host}/view?photo=${title}` if(title) { try{ const { response } = await fetch(apiurl).then(response => response.json()); + console.log(response) let date = response.date; let photourl = response.directurl; var dateStr = new Date(); @@ -37,7 +38,7 @@ async function getFileUrl() { const params = new URLSearchParams(window.location.search) let title = params.get('photo') var secret = document.querySelector("#secret").value - const delfile = await fetch(`https://${window.location.host}/delete/${title}`, { + const delfile = await fetch(`http://${window.location.host}/delete/${title}`, { method: "DELETE", headers: { "secret": `${secret}`} })