@shopify/hydrogen 0.13.1 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1013](https://github.com/Shopify/hydrogen/pull/1013) [`94dc94ae`](https://github.com/Shopify/hydrogen/commit/94dc94aeb9dfd5e0120cab610203fdb4f0c61d3c) Thanks [@jplhomer](https://github.com/jplhomer)! - Fix CORS issue in StackBlitz
8
+
3
9
  ## 0.13.1
4
10
 
5
11
  ### Patch Changes
@@ -101,6 +101,10 @@ function useCreateShopRequest(body, locale) {
101
101
  ? (_a = Oxygen === null || Oxygen === void 0 ? void 0 : Oxygen.env) === null || _a === void 0 ? void 0 : _a.SHOPIFY_STOREFRONT_API_SECRET_TOKEN
102
102
  : null;
103
103
  const buyerIp = request.getBuyerIp();
104
+ const extraHeaders = {};
105
+ if (buyerIp) {
106
+ extraHeaders['Shopify-Storefront-Buyer-IP'] = buyerIp;
107
+ }
104
108
  return {
105
109
  key: [storeDomain, storefrontApiVersion, body, locale],
106
110
  url: `https://${storeDomain}/api/${storefrontApiVersion}/graphql.json`,
@@ -109,11 +113,11 @@ function useCreateShopRequest(body, locale) {
109
113
  method: 'POST',
110
114
  headers: {
111
115
  'X-Shopify-Storefront-Access-Token': secretToken !== null && secretToken !== void 0 ? secretToken : storefrontToken,
112
- 'Shopify-Storefront-Buyer-IP': buyerIp !== null && buyerIp !== void 0 ? buyerIp : '',
113
116
  'X-SDK-Variant': 'hydrogen',
114
117
  'X-SDK-Version': storefrontApiVersion,
115
118
  'content-type': 'application/json',
116
119
  'Accept-Language': (_b = locale) !== null && _b !== void 0 ? _b : defaultLocale,
120
+ ...extraHeaders,
117
121
  },
118
122
  },
119
123
  };
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "0.13.1";
1
+ export declare const LIB_VERSION = "0.13.2";
@@ -1 +1 @@
1
- export const LIB_VERSION = '0.13.1';
1
+ export const LIB_VERSION = '0.13.2';
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "0.13.1";
1
+ export declare const LIB_VERSION = "0.13.2";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
- exports.LIB_VERSION = '0.13.1';
4
+ exports.LIB_VERSION = '0.13.2';
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "engines": {
8
8
  "node": ">=14"
9
9
  },
10
- "version": "0.13.1",
10
+ "version": "0.13.2",
11
11
  "description": "Modern custom Shopify storefronts",
12
12
  "license": "MIT",
13
13
  "main": "dist/esnext/index.js",