Skip to content

Commit ac84e82

Browse files
committed
feat: request phase gzip field
1 parent f49d8f5 commit ac84e82

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

lib/utils/generateManifest/generateManifest.utils.js

+16-5
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ function jsToJson(config) {
228228
}
229229
}
230230

231+
if (Object.prototype.hasOwnProperty.call(rule, 'enableGZIP')) {
232+
if (rule.enableGZIP) {
233+
cdnRule.behaviors.push({
234+
name: 'enable_gzip',
235+
target: '',
236+
});
237+
}
238+
}
239+
231240
if (Object.prototype.hasOwnProperty.call(rule, 'bypassCache')) {
232241
if (rule.bypassCache) {
233242
cdnRule.behaviors.push({
@@ -305,11 +314,13 @@ function jsToJson(config) {
305314
});
306315
}
307316

308-
if (rule.enableGZIP === true) {
309-
cdnRule.behaviors.push({
310-
name: 'enable_gzip',
311-
target: '',
312-
});
317+
if (Object.prototype.hasOwnProperty.call(rule, 'enableGZIP')) {
318+
if (rule.enableGZIP) {
319+
cdnRule.behaviors.push({
320+
name: 'enable_gzip',
321+
target: '',
322+
});
323+
}
313324
}
314325

315326
if (rule.filterCookie) {

0 commit comments

Comments
 (0)