httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@hyperreal.org
Subject cvs commit: apache-1.3/src/modules/standard mod_rewrite.c
Date Wed, 27 Oct 1999 07:56:25 GMT
rse         99/10/27 00:56:24

  Modified:    src      CHANGES
               src/modules/standard mod_rewrite.c
  Log:
  Make sure mod_rewrite matches URL schemes case-insensitive and also allow
  additional (commonly used) URL schemes ldap:, news: and mailto:.
  
  Requested by: Klaus Johannes Rusch <KlausRusch@atmedia.net>
  Submitted by: Ralf S. Engelschall
  Reviewed by: Ralf S. Engelschall
  PR: 3140
  
  Revision  Changes    Path
  1.1440    +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1439
  retrieving revision 1.1440
  diff -u -r1.1439 -r1.1440
  --- CHANGES	1999/10/27 07:38:45	1.1439
  +++ CHANGES	1999/10/27 07:56:17	1.1440
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.10
   
  +  *) Make sure mod_rewrite matches URL schemes case-insensitive and also allow
  +     additional (commonly used) URL schemes ldap:, news: and mailto:.
  +     [Ralf S. Engelschall, Klaus Johannes Rusch <KlausRusch@atmedia.net>] PR#3140
  +
     *) Overhauled ApacheBench (ab) manpage ab.8.
        [Simon Baldwin <simonb@sco.com>] PR#5139
   
  
  
  
  1.146     +37 -16    apache-1.3/src/modules/standard/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
  retrieving revision 1.145
  retrieving revision 1.146
  diff -u -r1.145 -r1.146
  --- mod_rewrite.c	1999/10/21 20:45:36	1.145
  +++ mod_rewrite.c	1999/10/27 07:56:22	1.146
  @@ -1131,13 +1131,19 @@
               return OK;
           }
           else if (  (strlen(r->filename) > 7 &&
  -                    strncasecmp(r->filename, "http://", 7) == 0)
  +                    strncasecmp(r->filename, "http://",   7) == 0)
                   || (strlen(r->filename) > 8 &&
  -                    strncasecmp(r->filename, "https://", 8) == 0)
  +                    strncasecmp(r->filename, "https://",  8) == 0)
                   || (strlen(r->filename) > 9 &&
                       strncasecmp(r->filename, "gopher://", 9) == 0)
                   || (strlen(r->filename) > 6 &&
  -                    strncasecmp(r->filename, "ftp://", 6) == 0)    ) {
  +                    strncasecmp(r->filename, "ftp://",    6) == 0)
  +                || (strlen(r->filename) > 5 &&
  +                    strncasecmp(r->filename, "ldap:",     5) == 0)
  +                || (strlen(r->filename) > 5 &&
  +                    strncasecmp(r->filename, "news:",     5) == 0)
  +                || (strlen(r->filename) > 7 &&
  +                    strncasecmp(r->filename, "mailto:",   7) == 0)) {
               /* it was finally rewritten to a remote URL */
   
               /* skip 'scheme:' */
  @@ -1391,13 +1397,19 @@
               return OK;
           }
           else if (  (strlen(r->filename) > 7 &&
  -                    strncmp(r->filename, "http://", 7) == 0)
  +                    strncasecmp(r->filename, "http://",   7) == 0)
                   || (strlen(r->filename) > 8 &&
  -                    strncmp(r->filename, "https://", 8) == 0)
  +                    strncasecmp(r->filename, "https://",  8) == 0)
                   || (strlen(r->filename) > 9 &&
  -                    strncmp(r->filename, "gopher://", 9) == 0)
  +                    strncasecmp(r->filename, "gopher://", 9) == 0)
                   || (strlen(r->filename) > 6 &&
  -                    strncmp(r->filename, "ftp://", 6) == 0)    ) {
  +                    strncasecmp(r->filename, "ftp://",    6) == 0)
  +                || (strlen(r->filename) > 5 &&
  +                    strncasecmp(r->filename, "ldap:",     5) == 0)
  +                || (strlen(r->filename) > 5 &&
  +                    strncasecmp(r->filename, "news:",     5) == 0)
  +                || (strlen(r->filename) > 7 &&
  +                    strncasecmp(r->filename, "mailto:",   7) == 0)) {
               /* it was finally rewritten to a remote URL */
   
               /* because we are in a per-dir context
  @@ -2005,10 +2017,13 @@
       i = strlen(r->filename);
       if (   prefixstrip
           && !(   r->filename[0] == '/'
  -             || (   (i > 7 && strncasecmp(r->filename, "http://", 7) == 0)
  -                 || (i > 8 && strncasecmp(r->filename, "https://", 8) ==
0)
  +             || (   (i > 7 && strncasecmp(r->filename, "http://",   7) ==
0)
  +                 || (i > 8 && strncasecmp(r->filename, "https://",  8) ==
0)
                    || (i > 9 && strncasecmp(r->filename, "gopher://", 9) ==
0)
  -                 || (i > 6 && strncasecmp(r->filename, "ftp://", 6) == 0))))
{
  +                 || (i > 6 && strncasecmp(r->filename, "ftp://",    6) ==
0)
  +                 || (i > 5 && strncasecmp(r->filename, "ldap:",     5) ==
0)
  +                 || (i > 5 && strncasecmp(r->filename, "news:",     5) ==
0)
  +                 || (i > 7 && strncasecmp(r->filename, "mailto:",   7) ==
0)))) {
           rewritelog(r, 3, "[per-dir %s] add per-dir prefix: %s -> %s%s",
                      perdir, r->filename, perdir, r->filename);
           r->filename = ap_pstrcat(r->pool, perdir, r->filename, NULL);
  @@ -2073,10 +2088,13 @@
        *  directly force an external HTTP redirect.
        */
       i = strlen(r->filename);
  -    if (   (i > 7 && strncasecmp(r->filename, "http://", 7)   == 0)
  -        || (i > 8 && strncasecmp(r->filename, "https://", 8)  == 0)
  +    if (   (i > 7 && strncasecmp(r->filename, "http://",   7) == 0)
  +        || (i > 8 && strncasecmp(r->filename, "https://",  8) == 0)
           || (i > 9 && strncasecmp(r->filename, "gopher://", 9) == 0)
  -        || (i > 6 && strncasecmp(r->filename, "ftp://", 6)    == 0)) {
  +        || (i > 6 && strncasecmp(r->filename, "ftp://",    6) == 0)
  +        || (i > 5 && strncasecmp(r->filename, "ldap:",     5) == 0)
  +        || (i > 5 && strncasecmp(r->filename, "news:",     5) == 0)
  +        || (i > 7 && strncasecmp(r->filename, "mailto:",   7) == 0) ) {
           if (perdir == NULL) {
               rewritelog(r, 2,
                          "implicitly forcing redirect (rc=%d) with %s",
  @@ -2433,10 +2451,13 @@
       int port;
   
       i = strlen(r->filename);
  -    if (!(   (i > 7 && strncasecmp(r->filename, "http://", 7)   == 0)
  -          || (i > 8 && strncasecmp(r->filename, "https://", 8)  == 0)
  +    if (!(   (i > 7 && strncasecmp(r->filename, "http://",   7) == 0)
  +          || (i > 8 && strncasecmp(r->filename, "https://",  8) == 0)
             || (i > 9 && strncasecmp(r->filename, "gopher://", 9) == 0)
  -          || (i > 6 && strncasecmp(r->filename, "ftp://", 6)    == 0))) {
  +          || (i > 6 && strncasecmp(r->filename, "ftp://",    6) == 0)
  +          || (i > 5 && strncasecmp(r->filename, "ldap:",     5) == 0)
  +          || (i > 5 && strncasecmp(r->filename, "news:",     5) == 0)
  +          || (i > 7 && strncasecmp(r->filename, "mailto:",   7) == 0))) {
   
           thisserver = ap_get_server_name(r);
           port = ap_get_server_port(r);
  
  
  

Mime
View raw message