Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Match on header #26

Open
splushii opened this issue Sep 4, 2019 · 6 comments
Open

Match on header #26

splushii opened this issue Sep 4, 2019 · 6 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@splushii
Copy link

splushii commented Sep 4, 2019

Currently, we only support matching on path, query (and domain / Host header via domains). There are usecases which would benefit from header matching.

@ghost ghost added the enhancement New feature or request label Sep 5, 2019
@ghost
Copy link

ghost commented Sep 5, 2019

This is dependent on multi-dimensional collision detection as described in #12

@splushii
Copy link
Author

splushii commented Oct 4, 2019

We probably want to consider how domains works when implementing header matching (because domains actually does header matching but specifically for the field host)

@splushii splushii added this to the v2 milestone Oct 4, 2019
@splushii splushii self-assigned this Oct 18, 2019
@splushii
Copy link
Author

splushii commented Oct 18, 2019

My general idea is to

  • Update schema to support header matching (and deprecate domain?)
  • Update schema to support specifying headers for ORM tests
  • Deployment tests
  • Implement changes in parser, validator, and varnish render
  • Support setting headers in runtests.py
  • Collision check header matches in validator
    • Add domain value to Host header for collision checking
    • Do not split collision checking on domain value (because there may be no domain). Alternatively, continue to split it and use an empty domain as one part of the split.
    • Handle domain_default collision checking (to incorporate the Host header). Alternatively, make domains required if domain_default is true.
  • Unit tests
  • Update docs

@splushii
Copy link
Author

Just a note to self. We need to make domains optional if we want to have sane support for matching on host headers with the new header matching.

@pascalgagneur
Copy link

Will this provide functionality to route to precompressed files depending on
"accept-encoding: gzip, deflate, br" header?

@splushii
Copy link
Author

It will be possible to match headers with the following syntax:

header:
  field: accept-encoding
  exact: "gzip, deflate, br"

It will also be possible to use regex, begins_with, etc instead of exact, like other matching methods.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants