@shopify/cli-kit 3.59.0 → 3.59.1
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/assets/cli-ruby/lib/shopify_cli/theme/dev_server/proxy.rb +7 -7
- package/assets/cli-ruby/lib/shopify_cli/theme/repl/api.rb +3 -1
- package/dist/public/common/version.d.ts +1 -1
- package/dist/public/common/version.js +1 -1
- package/dist/public/common/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -25,8 +25,8 @@ module ShopifyCLI
|
|
|
25
25
|
]
|
|
26
26
|
|
|
27
27
|
class Proxy
|
|
28
|
-
SESSION_COOKIE_NAME = "
|
|
29
|
-
SESSION_COOKIE_REGEXP = /#{SESSION_COOKIE_NAME}=(
|
|
28
|
+
SESSION_COOKIE_NAME = "_shopify_essential"
|
|
29
|
+
SESSION_COOKIE_REGEXP = /#{SESSION_COOKIE_NAME}=([^;]*)(;|$)/
|
|
30
30
|
SESSION_COOKIE_MAX_AGE = 60 * 60 * 23 # 1 day - leeway of 1h
|
|
31
31
|
IGNORED_ENDPOINTS = %w[
|
|
32
32
|
shopify/monorail
|
|
@@ -94,9 +94,9 @@ module ShopifyCLI
|
|
|
94
94
|
|
|
95
95
|
def secure_session_id
|
|
96
96
|
if secure_session_id_expired?
|
|
97
|
-
@ctx.debug("Refreshing preview
|
|
97
|
+
@ctx.debug("Refreshing preview _shopify_essential cookie")
|
|
98
98
|
response = request("HEAD", "/", query: [[:preview_theme_id, theme_id]])
|
|
99
|
-
@secure_session_id =
|
|
99
|
+
@secure_session_id = extract_shopify_essential_from_response_headers(response)
|
|
100
100
|
@last_session_cookie_refresh = Time.now
|
|
101
101
|
end
|
|
102
102
|
|
|
@@ -215,7 +215,7 @@ module ShopifyCLI
|
|
|
215
215
|
Time.now - @last_session_cookie_refresh >= SESSION_COOKIE_MAX_AGE
|
|
216
216
|
end
|
|
217
217
|
|
|
218
|
-
def
|
|
218
|
+
def extract_shopify_essential_from_response_headers(headers)
|
|
219
219
|
return unless headers["set-cookie"]
|
|
220
220
|
|
|
221
221
|
headers["set-cookie"][SESSION_COOKIE_REGEXP, 1]
|
|
@@ -235,9 +235,9 @@ module ShopifyCLI
|
|
|
235
235
|
response_headers["location"].gsub!(%r{(https://#{shop})}, "http://#{host(env)}")
|
|
236
236
|
end
|
|
237
237
|
|
|
238
|
-
new_session_id =
|
|
238
|
+
new_session_id = extract_shopify_essential_from_response_headers(response_headers)
|
|
239
239
|
if new_session_id
|
|
240
|
-
@ctx.debug("New
|
|
240
|
+
@ctx.debug("New _shopify_essential cookie from response")
|
|
241
241
|
@secure_session_id = new_session_id
|
|
242
242
|
@last_session_cookie_refresh = Time.now
|
|
243
243
|
end
|
|
@@ -4,6 +4,8 @@ module ShopifyCLI
|
|
|
4
4
|
module Theme
|
|
5
5
|
class Repl
|
|
6
6
|
class Api
|
|
7
|
+
SESSION_COOKIE_NAME = DevServer::Proxy::SESSION_COOKIE_NAME
|
|
8
|
+
|
|
7
9
|
attr_reader :ctx, :url, :repl
|
|
8
10
|
|
|
9
11
|
def initialize(ctx, url, repl)
|
|
@@ -60,7 +62,7 @@ module ShopifyCLI
|
|
|
60
62
|
end
|
|
61
63
|
|
|
62
64
|
def cookie
|
|
63
|
-
@cookie ||= "storefront_digest=#{repl.storefront_digest};
|
|
65
|
+
@cookie ||= "storefront_digest=#{repl.storefront_digest}; #{SESSION_COOKIE_NAME}=#{repl.secure_session_id}"
|
|
64
66
|
end
|
|
65
67
|
|
|
66
68
|
def shop
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CLI_KIT_VERSION = "3.59.
|
|
1
|
+
export declare const CLI_KIT_VERSION = "3.59.1";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const CLI_KIT_VERSION = '3.59.
|
|
1
|
+
export const CLI_KIT_VERSION = '3.59.1';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const CLI_KIT_VERSION = '3.59.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/public/common/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAA","sourcesContent":["export const CLI_KIT_VERSION = '3.59.1'\n"]}
|