rse 98/07/09 10:13:58
Modified: src/modules/standard mod_rewrite.c
Log:
Replace a very old in-place hack for APACHE_SSL with a more clean
ap_http_method() based variant (which is still ok for Apache-SSL because it
patches ap_http_method() itself). This way there is now really _no_ sort of
crypto hook in the official Apache distribution ;-)
Revision Changes Path
1.122 +9 -9 apache-1.3/src/modules/standard/mod_rewrite.c
Index: mod_rewrite.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -r1.121 -r1.122
--- mod_rewrite.c 1998/07/08 17:47:18 1.121
+++ mod_rewrite.c 1998/07/09 17:13:56 1.122
@@ -2330,21 +2330,21 @@
char host[LONG_STRING_LEN];
char buf[MAX_STRING_LEN];
char *olduri;
+ int l;
-#ifdef APACHE_SSL
- if ( (!r->connection->client->ssl &&
- strncasecmp(r->filename, "http://", 7) == 0)
- || (r->connection->client->ssl &&
- strncasecmp(r->filename, "https://", 8) == 0)) {
-#else
- if (strncasecmp(r->filename, "http://", 7) == 0) {
-#endif
+ cp = ap_http_method(r);
+ l = strlen(cp);
+ if ( strlen(r->filename) > l+3
+ && strncasecmp(r->filename, cp, l) == 0
+ && r->filename[l] == ':'
+ && r->filename[l+1] == '/'
+ && r->filename[l+2] == '/' ) {
/* there was really a rewrite to a remote path */
olduri = ap_pstrdup(r->pool, r->filename); /* save for logging */
/* cut the hostname and port out of the URI */
- ap_cpystrn(buf, r->filename+strlen(ap_http_method(r))+3,
sizeof(buf));
+ ap_cpystrn(buf, r->filename+(l+3), sizeof(buf));
hostp = buf;
for (cp = hostp; *cp != '\0' && *cp != '/' && *cp != ':'; cp++)
;