@speedkit/cli 2.53.1 → 2.54.0

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,3 +1,17 @@
1
+ # [2.54.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.53.2...v2.54.0) (2024-08-23)
2
+
3
+
4
+ ### Features
5
+
6
+ * **onboarding:** add no-store to cache-controlHeader ([c023010](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/c023010872de6eb4a95ed41596ebb82e77dcf02c))
7
+
8
+ ## [2.53.2](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.53.1...v2.53.2) (2024-08-22)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **onboarding:** fix unsupported encoding error ([6242b03](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/6242b038a061f309bec70bdc4b7fab02e73b0d64))
14
+
1
15
  ## [2.53.1](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.53.0...v2.53.1) (2024-08-22)
2
16
 
3
17
 
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @speedkit/cli
21
21
  $ sk COMMAND
22
22
  running command...
23
23
  $ sk (--version)
24
- @speedkit/cli/2.53.1 linux-x64 node-v20.17.0
24
+ @speedkit/cli/2.54.0 linux-x64 node-v20.17.0
25
25
  $ sk --help [COMMAND]
26
26
  USAGE
27
27
  $ sk COMMAND
@@ -96,13 +96,15 @@ class CustomerDomainDocumentResponse {
96
96
  const contentType = event.responseHeaders.find((headerRecord) => {
97
97
  return headerRecord.name.toLowerCase() === "content-type";
98
98
  })?.["value"] || "";
99
- const charset = contentType.split("charset=")?.[1];
99
+ let charset = contentType.split("charset=")?.[1] || "utf-8";
100
100
  const { body, base64Encoded } = await client.send("Fetch.getResponseBody", {
101
101
  requestId: event.requestId,
102
102
  });
103
103
  if (base64Encoded) {
104
- // todo get encodingHeader for target encoding
105
- return Buffer.from(body, "base64").toString(charset || "utf-8");
104
+ if (charset.includes("ISO-8859")) {
105
+ charset = "latin1";
106
+ }
107
+ return Buffer.from(body, "base64").toString(charset);
106
108
  }
107
109
  return body;
108
110
  }
@@ -33,7 +33,10 @@ class VirtualOrestesApp {
33
33
  if (!response.headers.get("Content-Type").includes("html")) {
34
34
  return;
35
35
  }
36
- const customHeaders = this.prepareCustomHeaders(originUrl);
36
+ const hasNoStoreFlag = response.headers
37
+ .get("Cache-Control")
38
+ ?.includes("no-store");
39
+ const customHeaders = this.prepareCustomHeaders(originUrl, hasNoStoreFlag);
37
40
  // CDN Redirect
38
41
  if (originUrl !== response.url) {
39
42
  return this.handleCdnRedirect(customHeaders, response, event);
@@ -142,7 +145,7 @@ class VirtualOrestesApp {
142
145
  response.setHeader("server-timing", "pop;desc=LOCAL;dur=1,cache;desc=CACHE,hotness;desc=1,proto;desc=h3");
143
146
  return response;
144
147
  }
145
- prepareCustomHeaders(originUrl) {
148
+ prepareCustomHeaders(originUrl, hasNoStore = false) {
146
149
  const time = new Date().toUTCString();
147
150
  const originDomain = new URL(originUrl).origin;
148
151
  return [
@@ -155,7 +158,7 @@ class VirtualOrestesApp {
155
158
  { name: "timing-allow-origin", value: originDomain },
156
159
  {
157
160
  name: "Cache-Control",
158
- value: "public,browser-ttl=0,sw-max-age=31536000,max-age=31469674",
161
+ value: `public,browser-ttl=0,sw-max-age=31536000,max-age=31469674${hasNoStore ? ",no-store" : ""}`,
159
162
  },
160
163
  {
161
164
  name: "Alt-Svc",
@@ -712,5 +712,5 @@
712
712
  ]
713
713
  }
714
714
  },
715
- "version": "2.53.1"
715
+ "version": "2.54.0"
716
716
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@speedkit/cli",
3
3
  "description": "Speed Kit CLI",
4
- "version": "2.53.1",
4
+ "version": "2.54.0",
5
5
  "author": {
6
6
  "name": "Baqend.com",
7
7
  "email": "info@baqend.com"