-
Notifications
You must be signed in to change notification settings - Fork 5.1k
router: Allow using another header for virtual host matching #41280
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; | |
// * Routing :ref:`architecture overview <arch_overview_http_routing>` | ||
// * HTTP :ref:`router filter <config_http_filters_router>` | ||
|
||
// [#next-free-field: 18] | ||
// [#next-free-field: 19] | ||
message RouteConfiguration { | ||
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.RouteConfiguration"; | ||
|
||
|
@@ -133,6 +133,13 @@ message RouteConfiguration { | |
// :ref:`envoy_v3_api_msg_config.route.v3.VirtualHost`.domains field. | ||
bool ignore_port_in_host_matching = 14; | ||
|
||
// Normally, virtual host matching is done using the :authority (or | ||
// Host: in HTTP < 2) HTTP header. Setting this will instead, use a | ||
// different HTTP header for this purpose. This is intended to be | ||
// combined with an "early_header_mutation" extension to allow | ||
// alternate or simplified host values to be used for host matching. | ||
string alternate_header_for_host_matching = 18; | ||
Comment on lines
+136
to
+141
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The comments also could be simplified and needn't to refer the early header mutation. The new feature self should be a general/common feature and needn't be bound to early header mutation |
||
|
||
// Ignore path-parameters in path-matching. | ||
// Before RFC3986, URI were like(RFC1808): <scheme>://<net_loc>/<path>;<params>?<query>#<fragment> | ||
// Envoy by default takes ":path" as "<path>;<params>". | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may needn't this. We have provided regex support in the CEL, you can use CEL substitution formatter to extract something from specific attributes (like request header) as new header value. For simple example:
If the cel's support is not enough for you, you may could create a custom early mutation extension for this if possible.