From 7f79f1773d3623e0149bac8174b2d8d50615baee Mon Sep 17 00:00:00 2001 From: cutls Date: Tue, 16 Feb 2021 23:27:52 +0900 Subject: [PATCH] change to cors(last) --- app/js/login/manager.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/js/login/manager.js b/app/js/login/manager.js index 88731b70..9cce8d9d 100644 --- a/app/js/login/manager.js +++ b/app/js/login/manager.js @@ -1108,7 +1108,12 @@ input.addEventListener( if (prev_val != new_val) { if (new_val.length > 3) { var start = 'https://www.fediversesearch.com/search/?keyword=' + new_val - fetch(start) + fetch(start, { + method: 'GET', + headers: { + 'content-type': 'application/json', + } + }) .then(function (response) { if (!response.ok) { response.text().then(function (text) { @@ -1129,7 +1134,7 @@ input.addEventListener( var url = json.data[key] urls = urls + - `${escapeHTML(url.title ? url.title : url.uri)}, ` + `${escapeHTML(url.title ? url.title : url.uri)}, ` }) $('#ins-suggest').html(urls) } else {