From: Kohei Yoshino Date: Thu, 11 Jul 2019 15:05:33 +0000 (-0400) Subject: Bug 1380437 follow-up - Send API token only if available X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=463ccb46d5fae31ffff12b3b6c7e56ef9005d0e9;p=thirdparty%2Fbugzilla.git Bug 1380437 follow-up - Send API token only if available --- diff --git a/js/util.js b/js/util.js index 5f9374448..c071f7c28 100644 --- a/js/util.js +++ b/js/util.js @@ -391,6 +391,7 @@ Bugzilla.API = class API { */ static _init(endpoint, method = 'GET', params = {}) { const url = new URL(`${BUGZILLA.config.basepath}rest/${endpoint}`, location.origin); + const token = BUGZILLA.api_token; if (method === 'GET') { for (const [key, value] of Object.entries(params)) { @@ -410,7 +411,9 @@ Bugzilla.API = class API { } /** @todo Remove this once Bug 1477163 is solved */ - url.searchParams.set('Bugzilla_api_token', BUGZILLA.api_token); + if (token) { + url.searchParams.set('Bugzilla_api_token', token); + } return new Request(url, { method,