Remove stripToken functionality

This commit is contained in:
Antonio Calanducci 2024-06-03 15:29:26 +02:00
parent ad22dc24e7
commit 28141c34ab
1 changed files with 8 additions and 8 deletions

View File

@ -74,14 +74,14 @@ function enforce_legacy(r) {
context.userinfo = userinfo
context.record = buildAccountingRecord_legacy(context);
if (context.config["stripLegacyToken"] == true) {
var subreq_args = JSON.parse(JSON.stringify(context.request.args));
delete subreq_args["gcube-token"];
} else {
var subreq_args = context.request.args;
}
debug(context, "subrequest args:\n" + JSON.stringify(subreq_args), null, 2);
return context.request.subrequest("/_backend", { method: context.request.method, args: JSON.stringify(subreq_args), headers: context.request.headersIn })
// if (context.config["stripLegacyToken"] == true) {
// var subreq_args = JSON.parse(JSON.stringify(context.request.args));
// delete subreq_args["gcube-token"];
// } else {
// var subreq_args = context.request.args;
// }
// debug(context, "subrequest args:\n" + JSON.stringify(subreq_args), null, 2);
return context.request.subrequest("/_backend", { method: context.request.method, args: JSON.stringify(context.request.args), headers: context.request.headersIn })
}).then(reply => {
// debug(context, "response from backend\n" + reply.responseText);
debug(context, "Response status from backend: " + reply.status)