OpenSourceOrg / api

Light API based on the licenses spec
https://api.opensource.org/licenses/
GNU Affero General Public License v3.0
96 stars 18 forks source link

CORS blocking requests to the API #18

Open arcogabbo opened 3 years ago

arcogabbo commented 3 years ago

Requests on every endpoint of the API are blocked from the browser (currently using Chrome 93).

Example:

$.ajax({
  url:'https://api.opensource.org/licenses/',
  method:'get',
  success:(res)=>{
    console.log(res)
  },
  error:(xhr,s,err)=>{
    console.error(err)
  }
})

Output:

Access to XMLHttpRequest at 'https://api.opensource.org/licenses/' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
webmink commented 3 years ago

Sounds like something @paultag should look at.