Add another debug point.
This commit is contained in:
parent
cb824913b2
commit
947c9fa267
|
@ -5,7 +5,7 @@ function log(c, s){
|
|||
}
|
||||
|
||||
function debug(c, s){
|
||||
return {{ nginx_pep_debug_enabled }} ? c.request.error(s) : null
|
||||
return {{ nginx_pep_debug_enabled | lower }} ? c.request.error(s) : null
|
||||
}
|
||||
|
||||
function enforce(r) {
|
||||
|
@ -45,7 +45,8 @@ function enforce(r) {
|
|||
debug(context, "[REL] response status: " + reply.status)
|
||||
closeAccountingRecord(context.record, (reply.status === 200 || reply.status === 201 || reply.status === 204))
|
||||
context.request.subrequest("/_accounting", { detached : true, body : JSON.stringify(context.record) })
|
||||
r.return(reply.status, reply.responseBuffer)
|
||||
debug(njs.dump(reply))
|
||||
r.return(reply.status, reply.responseText)
|
||||
}).catch(e => { log(context, "Error .... " + njs.dump(e)); context.request.return(e.message === "Unauthorized" ? 403 : 500)} )
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue