envoyproxy / envoyproxy/gateway

Support RegularExpression as a HTTPRoute HeaderMatchType

Open
#5,370 5 comments 1 reaction 0 assignees View on GitHub
stale triage
Dominant language
Go
Stars
3k
Forks
864
Avg merge
2d 2h
Merged PRs (30d)
140

Description

*Description*:
The HTTPRoute resource allows for defining two [HeaderMatchType](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.HeaderMatchType): Exact (Core) and RegularExpression (Implementation specific).

Envoy Gateway only supports the Exact match type, and it would be really nice to have regex support.

I want to use it to make routing decisions based on a partial header match - like so:

```
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: grafana
spec:
rules:
- matches:
- header:
type: RegularExpression
name: "Host"
value: "^grafana"
backendRefs:
- name: grafana
port: 80
```

This would be really useful, as spec.hostnames only supports doing a full FQDN match, or a wildcard subdomain. I want to match like "grafana.*" so I can better repurpose my HTTPRoutes for a general setup, without having to use complex variable substitution and whatnot.

I believe it should be somewhat trivial to implement as[ it is already a feature in Envoy ](https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.