diff options
author | Eric Covener <covener@apache.org> | 2014-01-07 14:07:51 +0100 |
---|---|---|
committer | Eric Covener <covener@apache.org> | 2014-01-07 14:07:51 +0100 |
commit | be6ef336b248743839cbaf7c2cf2b369121cddfb (patch) | |
tree | c4be3de6ff4af930ee04fd14644f0499f377a348 /docs/manual/rewrite/flags.xml | |
parent | add some information about setenvif vs. subrequests for PR55957 (diff) | |
download | apache2-be6ef336b248743839cbaf7c2cf2b369121cddfb.tar.xz apache2-be6ef336b248743839cbaf7c2cf2b369121cddfb.zip |
avoid a tight busy loop with memory allocations when the [N] flag
isn't making progress.
If backported, probably increase the hard-coded limit to 32k from 10k.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1556206 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/rewrite/flags.xml')
-rw-r--r-- | docs/manual/rewrite/flags.xml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index efdb746c16..675eb8fa8e 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -392,14 +392,22 @@ certain string or letter repeatedly in a request. The example shown here will replace A with B everywhere in a request, and will continue doing so until there are no more As to be replaced. </p> - <highlight language="config">RewriteRule (.*)A(.*) $1B$2 [N]</highlight> - <p>You can think of this as a <code>while</code> loop: While this pattern still matches (i.e., while the URI still contains an <code>A</code>), perform this substitution (i.e., replace the <code>A</code> with a <code>B</code>).</p> +<p>In 2.5.0 and later, this module returns an error after 10,000 iterations to +protect against unintended looping. An alternative maximum number of +iterations can be specified by adding to the N flag. </p> +<highlight language="config"> +# Be willing to replace 1 character in each pass of the loop +RewriteRule (.+)[><;]$ $1 [N=32000] +# ... or, give up if after 10 loops +RewriteRule (.+)[><;]$ $1 [N=10] +</highlight> + </section> <section id="flag_nc"><title>NC|nocase</title> |