Fix issue prevent adding urls via Chromium browsers.
Cette révision appartient à :
@@ -70,15 +70,15 @@ const sendRequest = async (path, data) => {
|
||||
const url = new URL(instanceUrl);
|
||||
url.pathname = path;
|
||||
|
||||
console.debug(`Sending to '${instanceUrl}'.`, data, headers.length > 0 ? 'with auth header' : 'without auth header');
|
||||
|
||||
let opts = {method: data.length > 0 ? 'POST' : 'GET', headers: headers};
|
||||
let opts = {method: Object.keys(data).length > 0 ? 'POST' : 'GET', headers: headers};
|
||||
|
||||
if (data) {
|
||||
opts.headers['Content-Type'] = 'application/json';
|
||||
opts.body = JSON.stringify(data);
|
||||
}
|
||||
|
||||
console.debug(`Sending to '${instanceUrl}'.`, opts, headers.length > 0 ? 'with auth header' : 'without auth header');
|
||||
|
||||
const req = await fetch(url, opts);
|
||||
return {status: req.status, statusText: req.statusText, data: req};
|
||||
};
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur