Skip to content

String functions in CEL expressions in responseOverride #9335

Description

@towolf

Description:
We would like to use this expression to escape & in the Location header that we set to redirect to a login page

%CEL(request.path.replace("&", "%%26"))%

  responseOverride:
  - match:
      statusCodes:
      - type: Value
        value: 401
    response:
      header:
        set:
        - name: Location
          value: https://example.dev/oidc/login?rd="%REQ(:scheme)%://%REQ(:authority)%%CEL(request.path.replace("&", "%%26"))%"
      statusCode: 302

But the Envoy proxy logs this:
failed to create an expression: No overload found in reference resolve step for replace

[optional Relevant Links:]
I found this PR, which sounds like it added string function to CEL expressions, but maybe not in this context?

envoyproxy/envoy#40510

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions