How can I change HTTP headers in a Shopify store?

How can I change HTTP headers in a Shopify store?

abiratsis
Shopify Partner
10 1 0

Hello fellow developers. I am currently implementing a feature for my shopify store, in order to redirect users to the proper URL including locale based on current country (javascript). To achieve that, I will need to redirect users coming from Austria to the German locale (DE) since both countries speak German. For testing the feature, I will need to change the request country in my browser. So far I tried to change browser's location using Sensors as described here https://nordvpn.com/blog/change-location-google-chrome/#:~:text=Choosing%20custom%20locations%20in%2... but Shopify doesn't allow me to set the request location. I looked it up and it seems that the only way is by changing request's HTTP headers as shown below:

 
 
 	Access-Control-Allow-Credentials: true 
	Access-Control-Allow-Origin: ${origin_domain}

I already found this link https://shopify.dev/changelog/storefront-api-allows-for-cross-origin-resource-sharing although not sure if I can use it somehow for my case.

 

Does anyone knows if there is a way to change HTTP headers in Shopify?

 

Thank you in advance

 
Replies 0 (0)