Skip to content

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

@mdavis332

Description

@mdavis332

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    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