Changes with Apache 2.3.0
[ When backported to 2.2.x, remove entry from this file ]
+ *) mod_rewrite: Add the novary flag to RewriteCond.
+ [Ruediger Pluem]
+
*) Don't send spurious "100 Continue" response lines.
PR 38014 [Basant Kumar Kukreja <basant.kukreja sun.com>]
value of a header sent in the HTTP request.
Example: <code>%{HTTP:Proxy-Connection}</code> is
the value of the HTTP header
- ``<code>Proxy-Connection:</code>''.</li>
+ ``<code>Proxy-Connection:</code>''.
+ <p>If a HTTP header is used in a condition this header is added to
+ the Vary header of the response in case the condition evaluates to
+ to true for the request. It is <strong>not</strong> added if the
+ condition evaluates to false for the request. Adding the HTTP header
+ to the Vary header of the response is needed for proper caching.</p>
+ <p>It has to be kept in mind that conditions follow a short circuit
+ logic in the case of the '<strong><code>ornext|OR</code></strong>' flag
+ so that certain conditions might not be evaluated at all.</p></li>
<li>
<code>%{LA-U:variable}</code> can be used for look-aheads which perform
Without this flag you would have to write the condition/rule
pair three times.
</li>
+
+ <li>'<strong><code>novary|NV</code></strong>'
+ (<strong>n</strong>o <strong>v</strong>ary)<br />
+ If a HTTP header is used in the condition, this flag prevents
+ this header from being added to the Vary header of the response. <br />
+ Using this flag might break proper caching of the response if
+ the representation of this response varies on the value of this header.
+ So this flag should be only used if the meaning of the Vary header
+ is well understood.
+ </li>
</ul>
</li>
</ol>
#define CONDFLAG_NOCASE 1<<1
#define CONDFLAG_NOTMATCH 1<<2
#define CONDFLAG_ORNEXT 1<<3
+#define CONDFLAG_NOVARY 1<<4
#define RULEFLAG_NONE 1<<0
#define RULEFLAG_FORCEREDIRECT 1<<1
|| strcasecmp(key, "OR") == 0 ) {
cfg->flags |= CONDFLAG_ORNEXT;
}
+ else if ( strcasecmp(key, "novary") == 0
+ || strcasecmp(key, "NV") == 0 ) {
+ cfg->flags |= CONDFLAG_NOVARY;
+ }
else {
return apr_pstrcat(p, "RewriteCond: unknown flag '", key, "'", NULL);
}
rewritecond_entry *c = &conds[i];
rc = apply_rewrite_cond(c, ctx);
+ /*
+ * Reset vary_this if the novary flag is set for this condition.
+ */
+ if (c->flags & CONDFLAG_NOVARY) {
+ ctx->vary_this = NULL;
+ }
if (c->flags & CONDFLAG_ORNEXT) {
if (!rc) {
/* One condition is false, but another can be still true. */