![]() ![]() because you have explicitly permitted it. This exchange of headers is what makes CORS a secure mechanism. These headers indicate the origin of the request and the server must indicate via headers in the response whether it will serve resources to this origin. The fact that you have Access-Control-Allow-Origin: * on your site means any site can load any resource without issue, image, CSS, JS, etc. The CORS mechanism works by adding HTTP headers to cross-domain HTTP requests and responses. Strict-transport-security: max-age=31536000 includeSubDomains preload ![]() However try using and it won’t, because that header is missing % curl -I Įtag: "b7cd5a857e42c2d1e8f255d9882706f3-ssl" X-nf-request-id: 01GF589NKNVZCJETFHEYA2BPEM Strict-transport-security: max-age=31536000 Why? Because the headers for the image are allowing it % curl -I Ĭache-control: public, max-age=0, must-revalidateĮtag: "f6cd6850210c8455163769a4209fe12b-ssl" In your specific case, it seems that paste.ee doesnt bother to use CORS. This is specified by site A sending 'Access-Control-Allow-Origin' headers in its responses. Hi it the URL one might enter in the background image input? If so, it is nothing to do with Access-Control-Allow-Origin of your site, but that of the site the image is loaded from.įor example enter one of your portfolio images: and you’ll see it will load. paste.ee) to say 'I trust site B, so you can send XHR from it to me'. This is definitely not the first time I’ve tried to fix this problem, it seems to chase me constantly. I’m still confused as to why it still says my header is not present. GET requests do not have to use a preflight request unless you are passing custom headers. My “_headers” and “netlify.toml” files are both present and both have “Access-Control-Allow-Origin” set to “*”. var url = "" Ĭonsole.log('Successfully loaded image') My code is functional, but the image refuses to load due to a CORS blocking error message. I am trying to use a jQuery AJAX request to determine if a link contains a valid image.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |