You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2014/01/31 00:31:22 UTC
[09/12] git commit: Update the docs for header_rewrite and the
operators
Update the docs for header_rewrite and the operators
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/017a9961
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/017a9961
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/017a9961
Branch: refs/heads/5.0.x
Commit: 017a9961495bde7a8df17c15bba3c290dcdea1ac
Parents: 666bb42
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jan 30 15:45:42 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jan 30 15:45:42 2014 -0700
----------------------------------------------------------------------
doc/reference/plugins/header_rewrite.en.rst | 57 +++++++++++++-----------
plugins/header_rewrite/README | 57 ++++++++++++++----------
plugins/header_rewrite/condition.h | 4 +-
3 files changed, 66 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/017a9961/doc/reference/plugins/header_rewrite.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/plugins/header_rewrite.en.rst b/doc/reference/plugins/header_rewrite.en.rst
index 2069d26..92c04c2 100644
--- a/doc/reference/plugins/header_rewrite.en.rst
+++ b/doc/reference/plugins/header_rewrite.en.rst
@@ -47,13 +47,13 @@ Operators
The following operators are available::
- rm-header header-name [flags]
- add-header header <value> [flags]
- set-status <status-code> [flags]
- set-status-reason <value> [flags]
- set-config config <value> [flags]
- no-op [flags]
- counter counter-name [flags]
+ rm-header header-name [operator_flags]
+ add-header header <value> [operator_flags]
+ set-status <status-code> [operator_flags]
+ set-status-reason <value> [operator_flags]
+ set-config config <value> [operator_flags]
+ no-op [operator_flags]
+ counter counter-name [operator_flags]
The following operator(s) currently only works when instantiating the
plugin as a remap plugin::
@@ -74,7 +74,9 @@ For example (as a remap rule)::
Operator flags
--------------
-::
+
+The operator flags are optional, and must not contain whitespaces inside
+the brackets. Currently, only one flag is supported::
[L] Last rule, do not continue
@@ -95,22 +97,22 @@ Conditions
The conditions are used as qualifiers: The operators specified will
only be evaluated if the condition(s) are met::
- cond %{STATUS} operand [flags]
- cond %{RANDOM:nn} operand [flags]
- cond %{ACCESS:file} [flags]
- 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 %{PROTOCOL} operand [flags]
- cond %{PORT} operand [flags]
- cond %{HOST} operand [flags]
- cond %{TOHOST} operand [false]
- cond %{FROMHOST} operand [false]
- cond %{PATH} operand [false]
- cond %{PARAMS} operand [false]
- cond %{QUERY} operand [false]
+ cond %{STATUS} operand [condition_flags]
+ cond %{RANDOM:nn} operand [condition_flags]
+ cond %{ACCESS:file} [condition_flags]
+ cond %{TRUE} [condition_flags]
+ cond %{FALSE} [condition_flags]
+ cond %{HEADER:header-name} operand [condition_flags]
+ cond %{COOKIE:cookie-name} operand [condition_flags]
+ cond %{CLIENT-HEADER:header-name} operand [condition_flags]
+ cond %{PROTOCOL} operand [condition_flags]
+ cond %{PORT} operand [condition_flags]
+ cond %{HOST} operand [condition_flags]
+ cond %{TOHOST} operand [condition_flags]
+ cond %{FROMHOST} operand [condition_flags]
+ cond %{PATH} operand [condition_flags]
+ cond %{PARAMS} operand [condition_flags]
+ cond %{QUERY} operand [condition_flags]
The difference between HEADER and CLIENT-HEADER is that HEADER adapts to the
hook it's running in, whereas CLIENT-HEADER always applies to the client
@@ -132,9 +134,12 @@ configuration, but being the default it is also optional.
---------------
Condition flags
---------------
-::
- [NC] Not case sensitive condition (when applicable)
+The condition flags are optional, and you can combine more than one into
+a comma separated list of flags. Note that whitespaces are not allowed inside
+the brackets::
+
+ [NC] Not case sensitive condition (when applicable) [NOT IMPLEMENTED!]
[AND] AND with next condition (default)
[OR] OR with next condition
[NOT] Invert this condition
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/017a9961/plugins/header_rewrite/README
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/README b/plugins/header_rewrite/README
index fba6693..3ea6c6c 100644
--- a/plugins/header_rewrite/README
+++ b/plugins/header_rewrite/README
@@ -27,13 +27,13 @@ Operators
---------
The following operators are available:
- rm-header header-name [flags]
- add-header header <value> [flags]
- set-status <status-code> [flags]
- set-status-reason <value> [flags]
- set-config config <value> [flags]
- no-op [flags]
- counter counter-name [flags]
+ rm-header header-name [operator_flags]
+ add-header header <value> [operator_flags]
+ set-status <status-code> [operator_flags]
+ set-status-reason <value> [operator_flags]
+ set-config config <value> [operator_flags]
+ no-op [operator_flags]
+ counter counter-name [operator_flags]
The following operator(s) currently only works when instantiating the
plugin as a remap plugin:
@@ -55,6 +55,10 @@ For example (as a remap rule):
Operator flags
--------------
+
+The operator flags are optional, and must not contain whitespaces inside
+the brackets. Currently, only one flag is supported:
+
[L] Last rule, do not continue
@@ -75,22 +79,22 @@ Conditions
The conditions are used as qualifiers: The operators specified will
only be evaluated if the condition(s) are met.
- cond %{STATUS} operand [flags]
- cond %{RANDOM:nn} operand [flags]
- cond %{ACCESS:file} [flags]
- 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 %{PROTOCOL} operand [flags]
- cond %{PORT} operand [flags]
- cond %{HOST} operand [flags]
- cond %{TOHOST} operand [false]
- cond %{FROMHOST} operand [false]
- cond %{PATH} operand [false]
- cond %{PARAMS} operand [false]
- cond %{QUERY} operand [false]
+ cond %{STATUS} operand [condition_flags]
+ cond %{RANDOM:nn} operand [condition_flags]
+ cond %{ACCESS:file} [condition_flags]
+ cond %{TRUE} [condition_flags]
+ cond %{FALSE} [condition_flags]
+ cond %{HEADER:header-name} operand [condition_flags]
+ cond %{COOKIE:cookie-name} operand [condition_flags]
+ cond %{CLIENT-HEADER:header-name} operand [condition_flags]
+ cond %{PROTOCOL} operand [condition_flags]
+ cond %{PORT} operand [condition_flags]
+ cond %{HOST} operand [condition_flags]
+ cond %{TOHOST} operand [condition_flags]
+ cond %{FROMHOST} operand [condition_flags]
+ cond %{PATH} operand [condition_flags]
+ cond %{PARAMS} operand [condition_flags]
+ cond %{QUERY} operand [condition_flags]
The difference between HEADER and CLIENT-HEADER is that HEADER adapts to the
@@ -113,7 +117,12 @@ configuration, but being the default it is also optional.
Condition flags
---------------
- [NC] Not case sensitive condition (when applicable)
+
+The condition flags are optional, and you can combine more than one into
+a comma separated list of flags. Note that whitespaces are not allowed inside
+the brackets:
+
+ [NC] Not case sensitive condition (when applicable) [NOT IMPLEMENTED!]
[AND] AND with next condition (default)
[OR] OR with next condition
[NOT] Invert this condition
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/017a9961/plugins/header_rewrite/condition.h
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/condition.h b/plugins/header_rewrite/condition.h
index a33786c..308e943 100644
--- a/plugins/header_rewrite/condition.h
+++ b/plugins/header_rewrite/condition.h
@@ -37,9 +37,9 @@ enum CondModifiers {
COND_OR = 1,
COND_AND = 2,
COND_NOT = 4,
- COND_NOCASE = 8,
+ COND_NOCASE = 8, // Not implemented
COND_LAST = 16,
- COND_CHAIN = 32
+ COND_CHAIN = 32 // Not implemented
};