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

Routing Policy: Fix upstream selector base path #1122

Merged
merged 1 commit into from
Oct 2, 2019

Conversation

eloycoto
Copy link
Contributor

@eloycoto eloycoto commented Oct 2, 2019

If the URL for the upstream has a path, with the combination of
replace_path feature, the path the will be overwritten, and the expected
behaviour will not work as expected.

Example config:


{
  "url": "http://echo-api.3scale.net/test/",
  "condition": {
    "operations": [
      {
        "match": "path",
        "op": "matches",
        "value": "/echo/.*|/echo/?"
      }
    ]
  },
  "replace_path": "{{original_request.path | remove_first: '/echo'}}"
}

Calling to
:8080/echo/x?user=1

Without the change will call to http://echo-api.3scale.net/x?user=1

With this change, the target will be http://echo-api.3scale.net/test/x?user=1

Signed-off-by: Eloy Coto [email protected]

@eloycoto eloycoto requested a review from a team as a code owner October 2, 2019 11:45
@eloycoto eloycoto force-pushed the RoutingIssueFixPath branch 2 times, most recently from 45e466c to 7abee1b Compare October 2, 2019 12:00
If the URL for the upstream has a path, with the combination of
replace_path feature, the path the will be overwritten, and the expected
behaviour will not work as expected.

Example config:

```

{
  "url": "http://echo-api.3scale.net/test/",
  "condition": {
    "operations": [
      {
        "match": "path",
        "op": "matches",
        "value": "/echo/.*|/echo/?"
      }
    ]
  },
  "replace_path": "{{original_request.path | remove_first: '/echo'}}"
}
```
Calling to
:8080/echo/x?user=1

Without the change will call to `http://echo-api.3scale.net/x?user=1`

With this change the target will be `http://echo-api.3scale.net/test/x?user=1`

Signed-off-by: Eloy Coto <[email protected]>
@eloycoto eloycoto merged commit 6fd48e8 into 3scale:master Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants