Skip to content

Commit

Permalink
Rollback changes from router
Browse files Browse the repository at this point in the history
  • Loading branch information
thivindu committed Jan 29, 2025
1 parent b20aa89 commit 54bb726
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
3 changes: 1 addition & 2 deletions router/src/main/resources/interceptor/lib/consts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ RESPONSE = {
TRAILERS_TO_REPLACE = "trailersToReplace",
TRAILERS_TO_REMOVE = "trailersToRemove",
INTCPT_CONTEXT = "interceptorContext",
DYNAMIC_ENDPOINT = "dynamicEndpoint",
PATH_TO_REWRITE = "pathToRewrite"
DYNAMIC_ENDPOINT = "dynamicEndpoint"
}

DYNAMIC_ENDPOINT = {
Expand Down
9 changes: 0 additions & 9 deletions router/src/main/resources/interceptor/lib/interceptor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ local function handle_dynamic_endpoint(handle, interceptor_response_body, inv_co
end
end

local function rewritePath(handle, interceptor_response_body)
if interceptor_response_body[RESPONSE.PATH_TO_REWRITE] then
local path = interceptor_response_body[RESPONSE.PATH_TO_REWRITE]
handle:headers():replace(":path", path)
end
end

--- modify body
---@param handle table
---@param interceptor_response_body table
Expand Down Expand Up @@ -393,8 +386,6 @@ function interceptor.handle_request_interceptor(request_handle, intercept_servic
handle_dynamic_endpoint(request_handle, interceptor_response_body, inv_context)
--#endregion

rewritePath(request_handle, interceptor_response_body);

if interceptor_response_body[RESPONSE.INTCPT_CONTEXT] then
request_handle:logDebug("Updating interceptor context for the request_id: " .. request_id)
shared_info[REQUEST.INTCPT_CONTEXT] = interceptor_response_body[RESPONSE.INTCPT_CONTEXT]
Expand Down

0 comments on commit 54bb726

Please sign in to comment.