- <h3 class="SECT3"><a name="TAG-PATTERN" id="TAG-PATTERN">8.4.3. The
- Request Tag Pattern</a></h3>
- <p>Request tag patterns are used to change the applying actions based
- on the request's tags. Tags can be created based on HTTP headers with
- either the <a href=
- "actions-file.html#CLIENT-HEADER-TAGGER">client-header-tagger</a> or
- the <a href=
- "actions-file.html#SERVER-HEADER-TAGGER">server-header-tagger</a>
- action.</p>
- <p>Request tag patterns have to start with <span class=
- "QUOTE">"TAG:"</span>, so <span class="APPLICATION">Privoxy</span>
- can tell them apart from other patterns. Everything after the colon
- including white space, is interpreted as a regular expression with
- path pattern syntax, except that tag patterns aren't left-anchored
- automatically (<span class="APPLICATION">Privoxy</span> doesn't
- silently add a <span class="QUOTE">"^"</span>, you have to do it
- yourself if you need it).</p>
- <p>To match all requests that are tagged with <span class=
- "QUOTE">"foo"</span> your pattern line should be <span class=
- "QUOTE">"TAG:^foo$"</span>, <span class="QUOTE">"TAG:foo"</span>
- would work as well, but it would also match requests whose tags
- contain <span class="QUOTE">"foo"</span> somewhere. <span class=
- "QUOTE">"TAG: foo"</span> wouldn't work as it requires white
- space.</p>
- <p>Sections can contain URL and request tag patterns at the same
- time, but request tag patterns are checked after the URL patterns and
- thus always overrule them, even if they are located before the URL
- patterns.</p>
- <p>Once a new request tag is added, Privoxy checks right away if it's
- matched by one of the request tag patterns and updates the action
- settings accordingly. As a result request tags can be used to
- activate other tagger actions, as long as these other taggers look
- for headers that haven't already be parsed.</p>
- <p>For example you could tag client requests which use the <tt class=
- "LITERAL">POST</tt> method, then use this tag to activate another
- tagger that adds a tag if cookies are sent, and then use a block
- action based on the cookie tag. This allows the outcome of one
- action, to be input into a subsequent action. However if you'd
- reverse the position of the described taggers, and activated the
- method tagger based on the cookie tagger, no method tags would be
- created. The method tagger would look for the request line, but at
- the time the cookie tag is created, the request line has already been
- parsed.</p>
- <p>While this is a limitation you should be aware of, this kind of
- indirection is seldom needed anyway and even the example doesn't make
- too much sense.</p>
+ <h3 class="SECT3"><a name="TAG-PATTERN" id="TAG-PATTERN">8.4.3. The Request Tag Pattern</a></h3>
+ <p>Request tag patterns are used to change the applying actions based on the request's tags. Tags can be
+ created based on HTTP headers with either the <a href=
+ "actions-file.html#CLIENT-HEADER-TAGGER">client-header-tagger</a> or the <a href=
+ "actions-file.html#SERVER-HEADER-TAGGER">server-header-tagger</a> action.</p>
+ <p>Request tag patterns have to start with <span class="QUOTE">"TAG:"</span>, so <span class=
+ "APPLICATION">Privoxy</span> can tell them apart from other patterns. Everything after the colon including
+ white space, is interpreted as a regular expression with path pattern syntax, except that tag patterns aren't
+ left-anchored automatically (<span class="APPLICATION">Privoxy</span> doesn't silently add a <span class=
+ "QUOTE">"^"</span>, you have to do it yourself if you need it).</p>
+ <p>To match all requests that are tagged with <span class="QUOTE">"foo"</span> your pattern line should be
+ <span class="QUOTE">"TAG:^foo$"</span>, <span class="QUOTE">"TAG:foo"</span> would work as well, but it would
+ also match requests whose tags contain <span class="QUOTE">"foo"</span> somewhere. <span class="QUOTE">"TAG:
+ foo"</span> wouldn't work as it requires white space.</p>
+ <p>Sections can contain URL and request tag patterns at the same time, but request tag patterns are checked
+ after the URL patterns and thus always overrule them, even if they are located before the URL patterns.</p>
+ <p>Once a new request tag is added, Privoxy checks right away if it's matched by one of the request tag
+ patterns and updates the action settings accordingly. As a result request tags can be used to activate other
+ tagger actions, as long as these other taggers look for headers that haven't already be parsed.</p>
+ <p>For example you could tag client requests which use the <tt class="LITERAL">POST</tt> method, then use this
+ tag to activate another tagger that adds a tag if cookies are sent, and then use a block action based on the
+ cookie tag. This allows the outcome of one action, to be input into a subsequent action. However if you'd
+ reverse the position of the described taggers, and activated the method tagger based on the cookie tagger, no
+ method tags would be created. The method tagger would look for the request line, but at the time the cookie tag
+ is created, the request line has already been parsed.</p>
+ <p>While this is a limitation you should be aware of, this kind of indirection is seldom needed anyway and even
+ the example doesn't make too much sense.</p>