httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Douglass <miked...@texas.net>
Subject Re: Too soon for 1.2 commits ??
Date Tue, 09 Jul 1996 21:52:41 GMT
On Tue, 9 Jul 1996, Rob Hartill wrote:

> if anyone has spare apache time, could they look at making
> RefererIgnore case insensitive.
> 
> You won't believe how many people type in URLs mIxInG.tHe.CaSe

here's a simple one:

--- mod_log_referer.c	1996/07/09 21:47:52	1.1
+++ mod_log_referer.c	1996/07/09 21:51:50
@@ -162,6 +162,22 @@
     for (; s; s = s->next) open_referer_log (s, p);
 }
 
+char *strcasestr( pool *p, char *str1, char *str2 )
+{
+    char *s1, *s2, *ptr;
+
+    s1 = pstrdup( p, str1 );
+    s2 = pstrdup( p, str2 );
+
+    for( ptr = s1; *ptr; ptr++ )
+      *ptr = tolower( *ptr );
+
+    for( ptr = s2; *ptr; ptr++ )
+      *ptr = tolower( *ptr );
+
+    return ( strstr( s1, s2 ) );
+}
+
 int referer_log_transaction(request_rec *orig)
 {
     char **ptrptr, **ptrptr2;
@@ -200,7 +216,7 @@
 	      ptrptr < ptrptr2;
 	      ptrptr = (char **)((char *)ptrptr + cls->referer_ignore_list->elt_size)) 
 	    {
-		if(strstr(referer, *ptrptr))
+		if(strcasestr(orig->pool, referer, *ptrptr))
 		  return OK;
 	    }
 	  

Michael Douglass
Texas Networking, Inc.

  "To be a saint is to be an exception; to be a true man is the rule.
   Err, fail, sin if you must, but be upright.  To sin as little as
   possible is the law for men; to sin not at all is a dream for angels."

              - Victor Hugo, "Les Miserables"


Mime
View raw message