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

wildcard routes can be ambiguous #90

Open
sesquipedalian-dev opened this issue Jan 12, 2024 · 0 comments
Open

wildcard routes can be ambiguous #90

sesquipedalian-dev opened this issue Jan 12, 2024 · 0 comments

Comments

@sesquipedalian-dev
Copy link
Contributor

HTTP routes containing wildcards can be ambiguous with routes that are longer. For example:

- key: hello-wildcard
  kind: Behavior
  expect:
    http:
      method: GET
      path: /hello/*/bar
  actions:
    - reply_http:
        status_code: 200
        body: >
          { "hello": "foo" }

- key: hello-wildcard-2
  kind: Behavior
  expect:
    http:
      method: GET
      path: /hello/*
  actions:
    - reply_http:
        status_code: 200
        body: >
          { "hello": "bar" }

With these routes, calls to /hello/foo/bar will be ambiguous. It looks like once openmock loads in the templates, it is consistent until reloaded. For some loads, the response body will be {"hello": "foo"} and other times it will be {"hello": "bar"}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant