Add 'Access-Control-Allow-Origin: *' to '/atlassian-connect/all.js' to support CORS

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • Component/s: Ecosystem
    • None

      It would be great to be able to load the `all.js` library using the Fetch API.

      That would allow us to mock the request on our test and CI environments with far more ease than the current way (at least for static add-ons).

      Since the library is already 100% public, I see no downsides on allowing CORS for this resource alone, but it would allow us to do the following.

      fetch(scriptUrl).then((response) => {
        let script = document.createElement('script')
        script.type = 'text/javascript'
        script.text = response.body
        document.getElementsByTagName('head')[0].appendChild(script)
      }) 
      

      Which allows for a very simple way of mocking the library request on test environments.
       

            Assignee:
            Unassigned
            Reporter:
            42nd
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: