@allthings/cloud-toolkit 5.3.2-beta.1 → 5.3.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.
@@ -234,13 +234,13 @@ const withAcceptEncodingVary = (headers = {}) => {
234
234
  .flatMap((key) => splitDirectives(headers[key]))
235
235
  .filter((directive, index, all) => all.findIndex((other) => other.toLowerCase() === directive.toLowerCase()) === index);
236
236
  const hasAcceptEncoding = directives.some((directive) => directive.toLowerCase() === 'accept-encoding');
237
- const otherHeaders = Object.fromEntries(Object.entries(headers).filter(([key]) => !varyKeys.includes(key)));
238
- return {
239
- ...otherHeaders,
240
- [varyKeys[0] ?? 'vary']: (hasAcceptEncoding
237
+ const merged = directives.includes('*')
238
+ ? ['*']
239
+ : hasAcceptEncoding
241
240
  ? directives
242
- : [...directives, 'Accept-Encoding']).join(', '),
243
- };
241
+ : [...directives, 'Accept-Encoding'];
242
+ const otherHeaders = Object.fromEntries(Object.entries(headers).filter(([key]) => !varyKeys.includes(key)));
243
+ return { ...otherHeaders, [varyKeys[0] ?? 'vary']: merged.join(', ') };
244
244
  };
245
245
 
246
246
  const COMPRESSIBLE = [
@@ -211,13 +211,13 @@ const withAcceptEncodingVary = (headers = {}) => {
211
211
  .flatMap((key) => splitDirectives(headers[key]))
212
212
  .filter((directive, index, all) => all.findIndex((other) => other.toLowerCase() === directive.toLowerCase()) === index);
213
213
  const hasAcceptEncoding = directives.some((directive) => directive.toLowerCase() === 'accept-encoding');
214
- const otherHeaders = Object.fromEntries(Object.entries(headers).filter(([key]) => !varyKeys.includes(key)));
215
- return {
216
- ...otherHeaders,
217
- [varyKeys[0] ?? 'vary']: (hasAcceptEncoding
214
+ const merged = directives.includes('*')
215
+ ? ['*']
216
+ : hasAcceptEncoding
218
217
  ? directives
219
- : [...directives, 'Accept-Encoding']).join(', '),
220
- };
218
+ : [...directives, 'Accept-Encoding'];
219
+ const otherHeaders = Object.fromEntries(Object.entries(headers).filter(([key]) => !varyKeys.includes(key)));
220
+ return { ...otherHeaders, [varyKeys[0] ?? 'vary']: merged.join(', ') };
221
221
  };
222
222
 
223
223
  const COMPRESSIBLE = [
package/dist/lib.cjs.js CHANGED
@@ -243,13 +243,13 @@ const withAcceptEncodingVary = (headers = {}) => {
243
243
  .flatMap((key) => splitDirectives(headers[key]))
244
244
  .filter((directive, index, all) => all.findIndex((other) => other.toLowerCase() === directive.toLowerCase()) === index);
245
245
  const hasAcceptEncoding = directives.some((directive) => directive.toLowerCase() === 'accept-encoding');
246
- const otherHeaders = Object.fromEntries(Object.entries(headers).filter(([key]) => !varyKeys.includes(key)));
247
- return {
248
- ...otherHeaders,
249
- [varyKeys[0] ?? 'vary']: (hasAcceptEncoding
246
+ const merged = directives.includes('*')
247
+ ? ['*']
248
+ : hasAcceptEncoding
250
249
  ? directives
251
- : [...directives, 'Accept-Encoding']).join(', '),
252
- };
250
+ : [...directives, 'Accept-Encoding'];
251
+ const otherHeaders = Object.fromEntries(Object.entries(headers).filter(([key]) => !varyKeys.includes(key)));
252
+ return { ...otherHeaders, [varyKeys[0] ?? 'vary']: merged.join(', ') };
253
253
  };
254
254
 
255
255
  const COMPRESSIBLE = [
package/dist/lib.esm.mjs CHANGED
@@ -221,13 +221,13 @@ const withAcceptEncodingVary = (headers = {}) => {
221
221
  .flatMap((key) => splitDirectives(headers[key]))
222
222
  .filter((directive, index, all) => all.findIndex((other) => other.toLowerCase() === directive.toLowerCase()) === index);
223
223
  const hasAcceptEncoding = directives.some((directive) => directive.toLowerCase() === 'accept-encoding');
224
- const otherHeaders = Object.fromEntries(Object.entries(headers).filter(([key]) => !varyKeys.includes(key)));
225
- return {
226
- ...otherHeaders,
227
- [varyKeys[0] ?? 'vary']: (hasAcceptEncoding
224
+ const merged = directives.includes('*')
225
+ ? ['*']
226
+ : hasAcceptEncoding
228
227
  ? directives
229
- : [...directives, 'Accept-Encoding']).join(', '),
230
- };
228
+ : [...directives, 'Accept-Encoding'];
229
+ const otherHeaders = Object.fromEntries(Object.entries(headers).filter(([key]) => !varyKeys.includes(key)));
230
+ return { ...otherHeaders, [varyKeys[0] ?? 'vary']: merged.join(', ') };
231
231
  };
232
232
 
233
233
  const COMPRESSIBLE = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthings/cloud-toolkit",
3
- "version": "5.3.2-beta.1",
3
+ "version": "5.3.2",
4
4
  "description": "",
5
5
  "author": "Allthings GmbH",
6
6
  "keywords": [