You can set the Cache-Control header in your API Routes by using the res. Il sagit de lentĂȘte 'Access-Control-Allow-Origin'. If you need to revalidate the cache of a page that has been statically generated, you can do so by setting the revalidate prop in the page's getStaticProps function. From your sample code, If you want to request with cookies, The first point is necessary, So server must append Access-Control-Allow-Credentials header to make the cookie work. Make sure your request is Simple requests. If you want to access correctly, you can do so: Modify your server configuration and add the corresponding header to allow browser access. You cannot set Cache-Control headers in for pages or assets, as these headers will be overwritten in production to ensure that responses and static assets are cached effectively. Access to XMLHttpRequest at URL API from origin URL APP has been blocked by CORS policy: No Access-Control-Allow-Origin header is present on the requested resource. The Access-Control-Allow-Origin is response header, CORS is meaningless if the client can control it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |