httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@organic.com>
Subject Re: Bad choice of directory names for info- & status-modules
Date Wed, 24 Jul 1996 19:58:17 GMT
Okay, here's a patch. What it does is, as rst said, makes <Location> match
only "path segments". Namely, <Location /info> will match /info, /info/
and /info/whatever, but not /information.

Hopefully, this does what everyone wants. I'll plan to commit it around
4:00 PM PST unless someone objects.

Index: http_request.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_request.c,v
retrieving revision 1.11
diff -c -r1.11 http_request.c
*** http_request.c	1996/07/01 18:10:29	1.11
--- http_request.c	1996/07/24 19:53:36
***************
*** 359,365 ****
      void *per_dir_defaults = r->per_dir_config;
      
      core_dir_config **url = (core_dir_config **)url_array->elts;
!     int num_url = url_array->nelts;
      char *test_location = pstrdup (r->pool, r->uri);
  
      /* Go through the location entries, and check for matches. */
--- 359,365 ----
      void *per_dir_defaults = r->per_dir_config;
      
      core_dir_config **url = (core_dir_config **)url_array->elts;
!     int len, num_url = url_array->nelts;
      char *test_location = pstrdup (r->pool, r->uri);
  
      /* Go through the location entries, and check for matches. */
***************
*** 383,394 ****
  		get_module_config(entry_config, &core_module);
  	    entry_url = entry_core->d;
  
  	    this_conf = NULL;
  	    if (is_matchexp(entry_url)) {
  		if (!strcmp_match(test_location, entry_url))
  		    this_conf = entry_config;
  	    }
! 	    else if (!strncmp (test_location, entry_url, strlen(entry_url)))
  	        this_conf = entry_config;
  
  	    if (this_conf)
--- 383,398 ----
  		get_module_config(entry_config, &core_module);
  	    entry_url = entry_core->d;
  
+ 	    len = strlen(entry_url);
+ 
  	    this_conf = NULL;
  	    if (is_matchexp(entry_url)) {
  		if (!strcmp_match(test_location, entry_url))
  		    this_conf = entry_config;
  	    }
! 	    else if (!strncmp (test_location, entry_url, len) &&
! 		     (entry_url[len - 1] == '/' ||
! 		      test_location[len] == '/' || test_location[len] == '\0'))
  	        this_conf = entry_config;
  
  	    if (this_conf)


-- Alexei Kosut <akosut@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/




Mime
View raw message