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

'Accept' in request_headers doesn't match rule in certain cases when running http-server #38

Open
mdavis332 opened this issue Jul 25, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mdavis332
Copy link

Consider the rule:

rules:
  - path: /feed
    methods: ["GET"]
    request_headers:
      Authorization: "Token token=testing"
      Accept: "application/vnd.cif.v3+json"
    query_params:
      itype: "ipv4"

I couldn't get stream's http-server to match against the rule when a request came in that should have matched, e.g.:

`curl -H "Authorization: Token token=testing" -H "Accept: application/vnd.cif.v3+json" "http://localhost:8080/feed?itype=ipv4"

However, the moment I removed the "Accept" line from the request_headers key in the rule, the same request worked.

rules:
  - path: /feed
    methods: ["GET"]
    request_headers:
      Authorization: "Token token=testing"
    query_params:
      itype: "ipv4"

Either stream isn't picking up on it correctly or I've config'd something incorrectly in the rule or my clients. I tried from a few different HTTP clients including curl and the elastic-package system test (which I think uses Golang under the hood). Trying from either client exhibited the same failure.

Not sure if it has something to do with special chars or perhaps I have just missed something. Figured I'd file an issue in the event you're able to reproduce.

@andrewkroh andrewkroh added the bug Something isn't working label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants