From: dgaudet Date: Fri, 27 Jun 1997 02:26:32 +0000 (+0000) Subject: Update mod_rewrite from 3.0.5 to 3.0.6. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae530ec5fe1ab940ddeab4a5f2cde0e9257f2551;p=thirdparty%2Fapache%2Fhttpd.git Update mod_rewrite from 3.0.5 to 3.0.6. Reviewed by: Dean, Alexei Submitted by: Ralf Obtained from: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3@78388 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/APACHE_1_2_X/src/CHANGES b/APACHE_1_2_X/src/CHANGES index 4064a70e009..354a49365ba 100644 --- a/APACHE_1_2_X/src/CHANGES +++ b/APACHE_1_2_X/src/CHANGES @@ -1,5 +1,11 @@ Changes with Apache 1.2.1 - + + *) Update mod_rewrite from 3.0.5 to 3.0.6. New ruleflag + QSA=query_string_append. Also fixed a nasty bug in per-dir context: + when a URL http://... was used in concunction with a special + redirect flag, e.g. R=permanent, the permanent status was lost. + [Ronald Tschalaer , Ralf S. Engelschall] + *) If an object has multiple variants that are otherwise equal Apache would prefer the last listed variant rather than the first. [Paul Sutton] PR#94 diff --git a/APACHE_1_2_X/src/modules/standard/mod_rewrite.c b/APACHE_1_2_X/src/modules/standard/mod_rewrite.c index cb14372f98e..471359a07e5 100644 --- a/APACHE_1_2_X/src/modules/standard/mod_rewrite.c +++ b/APACHE_1_2_X/src/modules/standard/mod_rewrite.c @@ -61,7 +61,7 @@ ** |_| |_| |_|\___/ \__,_|___|_| \___| \_/\_/ |_| |_|\__\___| ** |_____| ** -** URL Rewriting Module, Version 3.0.5 (16-Apr-1997) +** URL Rewriting Module, Version 3.0.6 (15-Jun-1997) ** ** This module uses a rule-based rewriting engine (based on a ** regular-expression parser) to rewrite requested URLs on the fly. @@ -779,6 +779,10 @@ static const char *cmd_rewriterule_setflag(pool *p, rewriterule_entry *cfg, char || strcasecmp(key, "G") == 0 ) { cfg->flags |= RULEFLAG_GONE; } + else if ( strcasecmp(key, "qsappend") == 0 + || strcasecmp(key, "QSA") == 0 ) { + cfg->flags |= RULEFLAG_QSAPPEND; + } else { return pstrcat(p, "RewriteRule: unknown flag '", key, "'\n", NULL); } @@ -1559,6 +1563,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, char *perdir } rewritelog(r, 2, "[per-dir %s] redirect %s -> %s", perdir, r->filename, newuri); r->filename = pstrdup(r->pool, newuri); + r->status = p->forced_responsecode; return 1; } @@ -1602,7 +1607,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, char *perdir reduce_uri(r); /* split out on-the-fly generated QUERY_STRING '....?xxxxx&xxxx...' */ - splitout_queryargs(r); + splitout_queryargs(r, p->flags & RULEFLAG_QSAPPEND); /* if a MIME-type should be later forced for this URL, then remember this */ if (p->forced_mimetype != NULL) { @@ -1788,7 +1793,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char *perdir ** */ -static void splitout_queryargs(request_rec *r) +static void splitout_queryargs(request_rec *r, int qsappend) { char *q; char *olduri; @@ -1797,7 +1802,10 @@ static void splitout_queryargs(request_rec *r) if (q != NULL) { olduri = pstrdup(r->pool, r->filename); *q++ = '\0'; - r->args = pstrcat(r->pool, q, "&", r->args, NULL); + if (qsappend) + r->args = pstrcat(r->pool, q, "&", r->args, NULL); + else + r->args = pstrdup(r->pool, q); if (r->args[strlen(r->args)-1] == '&') r->args[strlen(r->args)-1] = '\0'; rewritelog(r, 3, "split uri=%s -> uri=%s, args=%s", olduri, r->filename, r->args); diff --git a/APACHE_1_2_X/src/modules/standard/mod_rewrite.h b/APACHE_1_2_X/src/modules/standard/mod_rewrite.h index c8bec8b537a..b1a90a38573 100644 --- a/APACHE_1_2_X/src/modules/standard/mod_rewrite.h +++ b/APACHE_1_2_X/src/modules/standard/mod_rewrite.h @@ -64,7 +64,7 @@ ** |_| |_| |_|\___/ \__,_|___|_| \___| \_/\_/ |_| |_|\__\___| ** |_____| ** -** URL Rewriting Module, Version 3.0.5 (16-Apr-1997) +** URL Rewriting Module, Version 3.0.6 (15-Jun-1997) ** ** This module uses a rule-based rewriting engine (based on a ** regular-expression parser) to rewrite requested URLs on the fly. @@ -171,6 +171,7 @@ #define RULEFLAG_PASSTHROUGH 1<<8 #define RULEFLAG_FORBIDDEN 1<<9 #define RULEFLAG_GONE 1<<10 +#define RULEFLAG_QSAPPEND 1<<11 #define MAPTYPE_TXT 1<<0 #define MAPTYPE_DBM 1<<1 @@ -334,7 +335,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, char *perdir static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char *perdir); /* URI transformation function */ -static void splitout_queryargs(request_rec *r); +static void splitout_queryargs(request_rec *r, int qsappend); static void reduce_uri(request_rec *r); static char *expand_tildepaths(request_rec *r, char *uri); static void expand_map_lookups(request_rec *r, char *uri, int uri_len);