Support Forums

Getting a CORS error due to Access-Control-Allow-Origin header set to a previous deployment url

I’m getting CORS the error below - looks like netlify deployment is trying to use a url from a previous build. It was working fine previously.

Access to fetch at ‘https://level-ground-cms.space/wp-json/api/menu’ from origin ‘https://level-ground.netlify.app’ has been blocked by CORS policy: The ‘Access-Control-Allow-Origin’ header has a value ‘https://60f1ade2620cf74beab6bd14--level-ground.netlify.app’ that is not equal to the supplied origin. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

Hey there,

Unfortunately, the site doesn’t exist no more! I presume that this may have been explicitly defined in a header rule, either configured manually or as part of your workflow.

If the issue persists, please do let us know.