You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by br...@apache.org on 2013/11/12 23:27:09 UTC
[08/10] git commit: TS-2316: header_rewrite: improved documentation
TS-2316: header_rewrite: improved documentation
Added variable expansion, counter operation and cookie condition.
Removed non-existient METHOD condition example.
Submitted by: Alexey Ivanov <ai...@linkedin.com>
Sponsored by: LinkedIn
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c83a5293
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c83a5293
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c83a5293
Branch: refs/heads/master
Commit: c83a52937791827a949d4b8469c7a4439860f6bb
Parents: 3d37f51
Author: Alexey Ivanov <ai...@linkedin.com>
Authored: Sun Nov 10 18:23:39 2013 -0800
Committer: Alexey Ivanov <ai...@linkedin.com>
Committed: Sun Nov 10 18:23:39 2013 -0800
----------------------------------------------------------------------
plugins/header_rewrite/README | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c83a5293/plugins/header_rewrite/README
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/README b/plugins/header_rewrite/README
index f90d62a..fba6693 100644
--- a/plugins/header_rewrite/README
+++ b/plugins/header_rewrite/README
@@ -4,9 +4,6 @@ perform various header "rewrite" rules (operations) on a request or
response. Currently, only one operation is supported, since we had to get
this rolling asap.
-Note that currently only static string "values" are supported. We'll add
-advanced features to allow for expansions in a future release.
-
Using the plugin
----------------
@@ -36,6 +33,7 @@ The following operators are available:
set-status-reason <value> [flags]
set-config config <value> [flags]
no-op [flags]
+ counter counter-name [flags]
The following operator(s) currently only works when instantiating the
plugin as a remap plugin:
@@ -60,6 +58,18 @@ Operator flags
[L] Last rule, do not continue
+Variable expansion
+------------------
+Currntly only limited variable expansion is supported in add-header. Supported
+substitutions include:
+ %<proto> Protocol
+ %<port> Port
+ %<chi> Client IP
+ %<cqhl> Client request length
+ %<cqhm> Client HTTP method
+ %<cquup> Client unmapped URI
+
+
Conditions
----------
The conditions are used as qualifiers: The operators specified will
@@ -71,8 +81,8 @@ only be evaluated if the condition(s) are met.
cond %{TRUE} [flags]
cond %{FALSE} [flags]
cond %{HEADER:header-name} operand [flags]
+ cond %{COOKIE:cookie-name} operand [flags]
cond %{CLIENT-HEADER:header-name} operand [flags]
- cond %{METHOD} operand [flags]
cond %{PROTOCOL} operand [flags]
cond %{PORT} operand [flags]
cond %{HOST} operand [flags]
@@ -103,7 +113,7 @@ configuration, but being the default it is also optional.
Condition flags
---------------
- [NC] Not ase sensitive condition (when applicable)
+ [NC] Not case sensitive condition (when applicable)
[AND] AND with next condition (default)
[OR] OR with next condition
[NOT] Invert this condition
@@ -133,11 +143,12 @@ Examples
--------
cond %{HEADER:X-Y-Foobar}
-cond %{METHOD} =GET [OR]
-cond %{METHOD} =POST
+cond %{COOKIE:X-DC} =DC1
add-header X-Y-Fiefum %{HEADER:X-Y-Foobar}
+add-header X-Forwarded-For %<chi>
rm-header X-Y-Foobar
rm-header Set-Cookie
+counter plugin.header_rewrite.x-y-foobar-dc1
cond %{HEADER:X-Y-Foobar} "Some string" [AND,NC]
Re: [08/10] git commit: TS-2316: header_rewrite: improved
documentation
Posted by Igor Galić <i....@brainsware.org>.
----- Original Message -----
> TS-2316: header_rewrite: improved documentation
arguable ;)
I'd rather this was not in the plugin's README, but in
doc/reference/plugins/<plugin>.en.rst
++ i
Igor Galić
Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 8716 7A9F 989B ABD5 100F 4008 F266 55D6 2998 1641