Skip to content

Commit 2d98e9e

Browse files
authored
Merge pull request #264 from Inchoo/bugfix/#231-edge-module-boolean-value-support
Added check that converts true/false string values to boolean
2 parents 4e848ce + ea7c654 commit 2d98e9e

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Diff for: Controller/Adminhtml/FastlyCdn/ImageOptimization/PushImageSettings.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function execute()
150150
'id' => $id,
151151
'type' => 'io_settings',
152152
'attributes' => [
153-
'webp' => true
153+
'webp' => true
154154
]
155155
]
156156
];
@@ -161,8 +161,10 @@ public function execute()
161161
$imageParams['data']['attributes']['jpeg_quality'] = $imageQuality;
162162
}
163163

164-
$this->api->configureImageOptimizationDefaultConfigOptions(json_encode($imageParams), $clone->number);
165-
164+
$this->api->configureImageOptimizationDefaultConfigOptions(
165+
json_encode($imageParams),
166+
$clone->number
167+
);
166168
}
167169
} else {
168170
$this->api->deleteRequest($clone->number, $reqName);

Diff for: Model/FrontControllerPlugin.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,12 @@ private function processData($data, $tag, $ttl, $limit, $limitingType = "path")
230230

231231
if ($usage >= $limit) {
232232
$this->response->setStatusHeader(429, null, 'API limit exceeded');
233-
if ( $limitingType == "path" )
233+
if ($limitingType == "path") {
234234
$this->response->setHeader('Surrogate-Control', 'max-age=' . $ttl);
235-
if ( $limitingType == "crawler" )
235+
}
236+
if ($limitingType == "crawler") {
236237
$this->response->setHeader('Fastly-Vary', 'Fastly-Client-IP');
238+
}
237239
$this->response->setBody('<h1>Request limit exceeded</h1>');
238240
$this->response->setNoCacheHeaders();
239241
return true;

Diff for: view/adminhtml/web/js/modly.js

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ define([
6464
$($(this).find('.modly-field')).each(function () {
6565
name = $(this).attr('name');
6666
value = $(this).val();
67+
if (value === "true" || value === "false") {
68+
value = (value === "true");
69+
}
6770
data[name] = value;
6871
});
6972
groupData.push(data);

0 commit comments

Comments
 (0)