Skip to content

Local reply is not forwarding x-request-id header to ext-proc #38261

Open
@xr

Description

Description:
Supposed we have a filter chain:

request -> jwt_authn -> ext-proc -> upstream

when jwt_authn failed it will trigger local reply, ext-proc will get from the OnResponseHeaders phases onwards, however, the request to ext-proc only contain a small set of the request headers, for example:

headers:{headers:{key:":status" raw_value:"401"} headers:{key:"www-authenticate" raw_value:"Bearer realm=\"http://localhost:10000/api\", error=\"invalid_token\""} headers:{key:"content-length" raw_value:"28"} headers:{key:"content-type" raw_value:"text/plain"}}

my question is:
is there any way to allow local reply to carry more headers? like x-request-id, so that ext-proc could do some processing based on the x-request-id, since it will hit the ext-proc filter anyway (onResponseHeaders)

notes

  1. i have configured HCM to generate requestId and preserve in response
  2. potentially we could use local reply modification to modify the response, but it would be great if ext_proc could capture those headers anyway. As the local reply modification has less flexibilities, for example, can not only modify certain field inside the response body

Metadata

Assignees

No one assigned

    Labels

    questionQuestions that are neither investigations, bugs, nor enhancements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions