Skip to content

Commit

Permalink
change to cors(last)
Browse files Browse the repository at this point in the history
  • Loading branch information
cutls committed Feb 16, 2021
1 parent 3f844bf commit 7f79f17
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/js/login/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -1129,7 +1134,7 @@ input.addEventListener(
var url = json.data[key]
urls =
urls +
`<a onclick="login('${url.url}')" class="pointer" title="${url.uri}">${escapeHTML(url.title ? url.title : url.uri)}</a>, `
`<a onclick="login('${url.uri}')" class="pointer" title="${url.uri}">${escapeHTML(url.title ? url.title : url.uri)}</a>, `
})
$('#ins-suggest').html(urls)
} else {
Expand Down

0 comments on commit 7f79f17

Please sign in to comment.