Confluence Macro Sending Out OPTIONS request instead of GET Request

I’m prototyping a Confluence macro for an internship and I need to make a call to the JIRA REST API from the .HBS file that’s rendered into view. I’ve tested out basic auth with curl to obtain the data I want with a GET request and that works but when I attempt to do the same from within the <script> tags in my .HBS file with fetch() the macro sends out an OPTIONS request instead without the header I set. Why is that and how do I fix this? My code is below:

let url = ''

        let h = new Headers();
        h.append('Accept', 'application/json');

        let encoded = window.btoa(' TOKEN');
        let auth = "Basic " + encoded;
        h.append('Authorization', auth)

        let req = new Request(url, {
            method: 'GET',
            headers: h

        .then( (res) => {
            return res.json().then( (data) => {
                if(res.ok) {
                    return data;
                } else {
                    return Promise.reject({status: res.status, data});
        .then((data) => {