generated from gCubeCI/Pipeline-Docker-Template
Add https protocol and hostname to redirect URLs
This commit is contained in:
parent
8cb8df28c9
commit
3021aa4ddd
|
@ -3,8 +3,6 @@ export default { config };
|
||||||
var config = {
|
var config = {
|
||||||
"pep_credentials": "pep_credentials",
|
"pep_credentials": "pep_credentials",
|
||||||
"debug": true,
|
"debug": true,
|
||||||
"legacy": true,
|
|
||||||
"stripLegacyToken": false,
|
|
||||||
"accounting": {
|
"accounting": {
|
||||||
"scopes": ["authorized_scope1", "authorizeed_scope2"],
|
"scopes": ["authorized_scope1", "authorizeed_scope2"],
|
||||||
"service_name": "docker_stack_name",
|
"service_name": "docker_stack_name",
|
||||||
|
|
|
@ -91,10 +91,10 @@ function enforce_legacy(r) {
|
||||||
context.request.subrequest("/_accounting_legacy", { detached: true, body: JSON.stringify([context.record]) })
|
context.request.subrequest("/_accounting_legacy", { detached: true, body: JSON.stringify([context.record]) })
|
||||||
// r.return(reply.status, reply.responseBody)
|
// r.return(reply.status, reply.responseBody)
|
||||||
log(context, "Accounting record sent:\n" + JSON.stringify(context.record, null, 2))
|
log(context, "Accounting record sent:\n" + JSON.stringify(context.record, null, 2))
|
||||||
debug(context, "Redirect URI: " + reply.headersOut["Location"])
|
debug(context, "Redirect URI: https://" + r.headersIn.host + reply.headersOut["Location"])
|
||||||
if (reply.status === 301 || reply.status === 302) {
|
if (reply.status === 301 || reply.status === 302) {
|
||||||
debug(context, "Redirecting...");
|
debug(context, "Redirecting...");
|
||||||
r.return(reply.status, reply.headersOut["Location"])
|
r.return(reply.status, "https://" + r.headersIn.host + reply.headersOut["Location"])
|
||||||
} else {
|
} else {
|
||||||
r.return(reply.status, reply.responseText)
|
r.return(reply.status, reply.responseText)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue