Skip to content

Commit 0c86c91

Browse files
committed
add offset variable
1 parent 82e016b commit 0c86c91

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

articles/frontdoor/rule-set-server-variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ When you use [Rule set actions](front-door-rules-engine-actions.md), you can use
3838
| `ssl_protocol` | The protocol of an established TLS connection.<br/> To access this server variable in a match condition, use [SSL protocol](rules-match-conditions.md?toc=%2fazure%2ffrontdoor%2fstandard-premium%2ftoc.json#ssl-protocol).|
3939
| `server_port` | The port of the server that accepted a request.<br/> To access this server variable in a match condition, use [Server port](rules-match-conditions.md?toc=%2fazure%2ffrontdoor%2fstandard-premium%2ftoc.json#server-port).|
4040
| `url_path` | Identifies the specific resource in the host that the web client wants to access. This is the part of the request URI without the arguments or leading slash.<br />For example, in the request `http://contoso.com:8080/article.aspx?id=123&title=fabrikam`, the `url_path` value is `article.aspx`. <br /> Azure Front Door supports dynamic capture of URL path with `{url_path:seg#}` server variable, and converts URL path to lowercase or uppercase with `{url_path.tolower}` or `{url_path.toupper}`. For more information, see [Server variable format](#server-variable-format) and [Server variables](rule-set-server-variables.md). <br/> To access this server variable in a match condition, use [Request path](rules-match-conditions.md#request-path) condition. |
41+
| `offset` | Offset corresponds to the index of the start segment, and length refers to how many segments to capture (including the one at index = offset). <br> Assuming offset and length are positive, the following logic applies: <br> <ul><li>If length isn't included, capture the segment at index = offset.</li><li> When length is included, capture segments from index = offset up until index = offset + length</li></ul><br>The following special cases are also handled:<br><ul><li>If offset is negative, count backwards from end of the path to get the starting segment.</li><li>If offset is a negative value greater than or equal to the number of segments, set to 0.</li><li>If offset is greater than the number of segments, the result is empty.</li><li>If length is 0, then return the single segment specified by offset.</li><li>If length is negative, treat it as a second offset and calculate backwards from the end of the path. If the value is less than offset, it results in an empty string.</li><li>If length is greater than the number of segments, return what remains in the path.</li> |
4142

4243
## Server variable format
4344

0 commit comments

Comments
 (0)