-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
enhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.help wantedNeeds help!Needs help!
Description
We have a requirement to perform header match if the value of a header is within a given range.
Today, route match happens based on the header's value (exact string comparison or regex matching). Can we add range as a third option there?
Something like: In the route config, headers section, range is specified as the lowKey and highKey. A match will happen if the header's value in the incoming request lies within the range.
Some options to implement this:
- Range is specified in the route headers
valuefield as a comma delimited string of the form "lowKey,highKey" and therangeentry is true. 'range' is false by default. . Example below, if the incoming request contains a header PartitionKey:5, this route is matched.
{
"name": "PartitionKey",
"value": "1,10",
"regex": false,
"range": true
}
- Another option is to have
valueas a JSON object and add avalueTypeentry which can be set todefault,regexorrange. When 'valueType='regex|defaultvalueis a string.
{
"name": "PartitionKey",
"value": {"low":1,"high":10},
"valueType": "range",
"regex": false, // possibly deprecate in the future
}
This will be a breaking change though.
Would love to hear any other suggestions as well. If we have consensus on the approach, I can take a stab at adding this support.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.help wantedNeeds help!Needs help!