From 44f6c966b014bf4e76ba11c44ddbfc07048f4949 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 17 Sep 2016 20:39:20 +0000 Subject: [PATCH] expand third common in the expression functions doc Explain some risks at looking at per-request environment variables set by other modules within . http://stackoverflow.com/questions/39462011/htaccess-if-else-always-selects-else git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1761272 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/expr.xml | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/docs/manual/expr.xml b/docs/manual/expr.xml index 10b4fd72ea..cc63aba521 100644 --- a/docs/manual/expr.xml +++ b/docs/manual/expr.xml @@ -488,7 +488,7 @@ listfunction ::= listfuncname "(" word ")" - + @@ -500,15 +500,16 @@ listfunction ::= listfuncname "(" word ")" during <If>) + v can also be used to access variables). + + - + + osenv @@ -531,13 +532,13 @@ listfunction ::= listfuncname "(" word ")" encoding + + or is not regular file) + regular file) @@ -547,8 +548,29 @@ listfunction ::= listfuncname "(" word ")"
NameDescriptionRestricted
NameDescriptionSpecial notes
req, http Get HTTP request header; header names may be added to the Vary header, see below
reqenv Lookup request environment variable (as a shortcut, - v can be used too to access - variables)
ordering
osenv Lookup operating system environment variable
noteLookup request note
Lookup request noteordering
env Return first match of note, reqenv, - osenv
ordering
tolower Convert string to lower case
toupper
file Read contents from a file (including line endings, when present) - yes
restricted
filemod Return last modification time of a file (or 0 if file does not exist - or is not regular file)yes
restricted
filesize Return size of a file (or 0 if file does not exist or is not - regular file)yes
restricted
ldap Escape characters as required by LDAP distinguished name escaping (RFC4514) and LDAP filter escaping (RFC4515).
-

The functions marked as "restricted" are not available in some modules - like mod_include.

+

The functions marked as "restricted" in the final column are not + available in some modules like mod_include.

+ +

The functions marked as "ordering" in the final column require some + consideration for the ordering of different components of the server, + especially when the function is used within the + <If> directive which is + evaluated relatively early.

+ + Environment variable ordering + When environment variables are looked up within an + <If> condition, it's important + to consider how extremely early in request processing that this + resolution occurs. As a guideline, any directive defined outside of virtual host + context (directory, location, htaccess) is not likely to have yet had a + chance to execute. SetEnvIf + in virtual host scope is one directive that runs prior to this resolution +
+
+ When reqenv is used outside of <If>, the resolution will generally occur later, but the + exact timing depends on the directive the expression has been used within. +

When the functions req or http are used, the header name will automatically be added to the Vary header of the -- 2.50.1