Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using path segment in RequestHeader transform not working #2261

Closed
RGFuaWVs opened this issue Sep 26, 2023 · 0 comments · Fixed by #2262
Closed

Using path segment in RequestHeader transform not working #2261

RGFuaWVs opened this issue Sep 26, 2023 · 0 comments · Fixed by #2262
Labels
Type: Bug Something isn't working
Milestone

Comments

@RGFuaWVs
Copy link
Contributor

Description

Using the same configuration syntax as for QueryRouteParameter, it is not possible to set a path segment as value using the RequestHeader transform. Is this behaviour intended or is it a bug?

To Reproduce

Configuration:

  "Routes": {
    "route1": {
      "ClusterId": "cluster1",
      "Match": {
        "Path": "/api/{plugin}/{**remainder}"
      },
      "Transforms": [
        {
          "QueryRouteParameter": "q",
          "Append": "plugin"
        },
        {
          "RequestHeader": "header1",
          "Set": "plugin"
        }
      ]
    }
  }

GET <domain>/api/foo/bar returns

{
    "method": "GET",
    "path": "/api/foo/bar",
    "query": {
        "q": "foo"
    },
    "headers": {
        "header1": "plugin"
    }
}

Expected Behaviour

GET <domain>/api/foo/bar returns

{
    "method": "GET",
    "path": "/api/foo/bar",
    "query": {
        "q": "foo"
    },
    "headers": {
        "header1": "foo"
    }
}
@RGFuaWVs RGFuaWVs added the Type: Bug Something isn't working label Sep 26, 2023
@RGFuaWVs RGFuaWVs changed the title Using path segment in RequestHeader transform not possible Using path segment in RequestHeader transform not working Sep 26, 2023
@Tratcher Tratcher added this to the YARP 2.x milestone Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants