From 8329da51a908cff630c04e99cba834115f6ae572 Mon Sep 17 00:00:00 2001 From: Eloy Coto Date: Fri, 13 Sep 2019 11:38:05 +0200 Subject: [PATCH] Logging: Added original request information on logging policy. This commit add the way to get the original request information on logging policy to be able to log full request information. Related to Issue #1082 Signed-off-by: Eloy Coto --- gateway/src/apicast/executor.lua | 4 ++-- gateway/src/apicast/policy/logging/logging.lua | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gateway/src/apicast/executor.lua b/gateway/src/apicast/executor.lua index 243dc7d61..e7700ea50 100644 --- a/gateway/src/apicast/executor.lua +++ b/gateway/src/apicast/executor.lua @@ -73,8 +73,8 @@ local function shared_build_context(executor) ctx.context = context end - if not ctx.original_request then - store_original_request(ctx) + if not context.original_request then + store_original_request(context) end return context diff --git a/gateway/src/apicast/policy/logging/logging.lua b/gateway/src/apicast/policy/logging/logging.lua index 928cc7e4f..5fc777718 100644 --- a/gateway/src/apicast/policy/logging/logging.lua +++ b/gateway/src/apicast/policy/logging/logging.lua @@ -77,6 +77,7 @@ local function get_request_context(context) } ctx.service = context.service or {} + ctx.original_request = context.original_request return LinkedList.readonly(ctx, ngx.var) end