Untitled
unknown
plain_text
2 years ago
667 B
68
Indexable
async function onResponse(context, url, request, response) {
// console.log(response);
// Update or Add new headers
// response.headers["Content-Type"] = "application/json";
// Update status Code
// response.statusCode = 500;
// Update Body
// Update Body
var body = response.body;
let featureGates = body["feature_gates"];
for (const key in featureGates) {
if (featureGates[key].value === false) {
featureGates[key].value = true;
}
}
body["feature_gates"] = featureGates;
response.body = body;
// Or map a local file as a body
// response.bodyFilePath = "~/Desktop/myfile.json"
// Done
return response;
}Editor is loading...
Leave a Comment