AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: Sam_78 on June 14, 2022, 10:27:34 AM

Title: NEW Chrome update about CORS
Post by: Sam_78 on June 14, 2022, 10:27:34 AM
Hi,

Does anyone have an idea where to update this https://developer.chrome.com/blog/private-network-access-preflight/  I am getting errors in browsers for some images which are on the same server and on refresh that error goes away

error example : has been blocked by CORS policy: Request had a target IP address space of `unknown` yet the resource is in address space `unknown`.
Image is on the same server

How or where to set this ? Access-Control-Request-Private-Network: true
Title: Re: NEW Chrome update about CORS
Post by: HADY on June 14, 2022, 10:41:07 AM
Hi,

Does anyone have an idea where to update this https://developer.chrome.com/blog/private-network-access-preflight/  I am getting errors in browsers for some images which are on the same server and on refresh that error goes away

error example : has been blocked by CORS policy: Request had a target IP address space of `unknown` yet the resource is in address space `unknown`.
Image is on the same server

How or where to set this ? Access-Control-Request-Private-Network: true


Cross-Origin Resource Sharing (CORS) errors occur when a server doesn't return the HTTP headers required by the CORS standard. To resolve a CORS error from an API Gateway REST API or HTTP API, you must reconfigure the API to meet the CORS standard.



Turn OFF the CORS plugin, reload the app, at this time you should still get the errors which are correct. ii. Turn it back ON, reload the app, if the APIs are successful, stop here.
Title: Re: NEW Chrome update about CORS
Post by: Sam_78 on June 14, 2022, 12:19:08 PM
Hi,

These are not API Calls. I am getting these errors for images. Product images are not loading and I get this error in console(inspect) . When I clear cache and reload the page it loads and some other image or JS or CSS script will not load with similar error.  I think we need to add this line somewhere in htaccess or in code and I am not sure where.
Title: Re: NEW Chrome update about CORS
Post by: Basara on June 15, 2022, 01:34:04 AM
Hello.
A similar issue was fixed in the 1.3.3 try to apply it
https://github.com/abantecart/abantecart-src/commit/b767023893adbd47697559b3c1f68724d3ebfb26
Title: Re: NEW Chrome update about CORS
Post by: Sam_78 on June 20, 2022, 11:31:18 AM
Hi, I am still having this issue

Access to CSS stylesheet at 'https://www.domain.com/admin/view/default/stylesheet/chosen.bootstrap.css' from origin 'https://www.domain.com' has been blocked by CORS policy: Request had a target IP address space of `unknown` yet the resource is in address space `public`.

On simple refresh this issue gets resolved and some other script or image gets missing.
Title: Re: NEW Chrome update about CORS
Post by: Sam_78 on June 20, 2022, 02:40:03 PM
All these scripts are from same server then there should be no question for CORS. I am confused how is this only applying to random images / scripts and not all of them.
Title: Re: NEW Chrome update about CORS
Post by: Basara on June 21, 2022, 12:15:34 AM
Hello. Did you apply the patch?
Please also clear all AbanteCart caches and check your store URL is same you visit in the browser
Title: Re: NEW Chrome update about CORS
Post by: Sam_78 on June 27, 2022, 02:55:37 PM
Yes I applied the patch and cleared browser and abanteCart cache. I also tried other solutions and it didn't work. 
Title: Re: NEW Chrome update about CORS
Post by: Basara on June 28, 2022, 02:26:54 AM
Hello.
Can you please post the URL to your store?