This commit is contained in:
10
script.js
10
script.js
@@ -51,18 +51,10 @@
|
||||
return url.replace(/\/+$/, '');
|
||||
}
|
||||
|
||||
function getServiceToken(el) {
|
||||
var token = el.getAttribute('data-service-token') || '';
|
||||
return (token || '').trim();
|
||||
}
|
||||
|
||||
function pingOpenViaImage(el, rawPath) {
|
||||
var baseUrl = getServiceUrl(el);
|
||||
if (!baseUrl) return;
|
||||
|
||||
var token = getServiceToken(el);
|
||||
var url = baseUrl + '/open?path=' + encodeURIComponent(rawPath);
|
||||
if (token) url += '&token=' + encodeURIComponent(token);
|
||||
|
||||
// Fire-and-forget without CORS.
|
||||
try {
|
||||
@@ -80,8 +72,6 @@
|
||||
var headers = {
|
||||
'Content-Type': 'application/json'
|
||||
};
|
||||
var token = getServiceToken(el);
|
||||
if (token) headers['X-Luxtools-Token'] = token;
|
||||
|
||||
return window.fetch(baseUrl + '/open', {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user