product-microgateway icon indicating copy to clipboard operation
product-microgateway copied to clipboard

Ability to not send the requestBody to interceptor when completely replacing the requestBody

Open suksw opened this issue 3 years ago • 0 comments

Describe your problem(s)

In an OpenAPI definition with an interceptor enabled, we pick the sections to be sent to the Interceptor Service by naming those sections under includes. Ex:

x-wso2-request-interceptor:
  scheme: https
  host: xml-interceptor
  port: 9081
  includes:
    - request_body
    - request_headers

Yet, there is a scenario we have to mention request_body under includes (i.e. send the request body to the interceptor) even when the request body is not needed at the interceptor. This is when the requestBody needs to be replaced completely depending on a different part of the request (header, requestContext, invocationContext).

This is because currently we are experiencing a behavior where the original requestBody reaches the backend when we replace the requestBody without taking the above step. (@renuka-fernando please correct me if I have misinterpreted)

Describe your solution

  • We can check if there is a way to rearrange the steps in the lua script to see if this can be avoided.
  • Check if this is a inherent behavior of the filter itself

How will you implement it


Optional Fields

Related Issues:

Suggested Labels:

Suggested Assignees:

suksw avatar Nov 08 '21 04:11 suksw