httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <hart...@ooo.lanl.gov>
Subject A patch to mod_userdir.c to better redirect ~user (1.1) (fwd)
Date Mon, 08 Jul 1996 09:12:14 GMT
Forwarded message:

> Message-Id: <199607062010.OAA02884@coke.indra.com>
> To: apache-bugs@mail.apache.org
> Subject: A patch to mod_userdir.c to better redirect ~user (1.1)
> Date: Sat, 06 Jul 1996 14:10:22 -0600
> From: Joe Ilacqua <spike@indra.com>
> Status: RO
> 
> 
> The following is a very small patch to Apache 1.1.  It alows /~user to
> be sent, as is, to a different server.  The 1.1 UserDir directive
> allows /~user to be redirected to specific URL on the remote server,
> but not to user the remote server's idea to /~user.  That is to say
> you can send /~user to "http://www.x.com/web/user", but not to
> "http://www.x.com/~user".
> 
> With this patch, if the UserDir is on a remote host, and ends in "~",
> the rest of the URL is passed on with out inserting a "/".  Thus
> 
> UserDir http://www.x.org/~
> 
> redirect "GET /~user/foo.html" to:
> 
> http://www.x.org/~user/foo.html
> 
> Without the patch it would be redirected to
> 
> http://www.x.org/~/user/foo.html
> 
> ->Spike
> 
> 
> *** mod_userdir.c.orig  Sat Jul  6 13:42:45 1996
> --- mod_userdir.c       Sat Jul  6 13:55:46 1996
> ***************
> *** 157,163 ****
>           filename = pstrcat (r->pool, userdir, "/", w, NULL);
>         }
>         else if (strchr(userdir, ':')) {
> !       redirect = pstrcat(r->pool, userdir, "/", w, dname, NULL);
>         table_set (r->headers_out, "Location", redirect);
>         return REDIRECT;
>         }
> --- 157,169 ----
>           filename = pstrcat (r->pool, userdir, "/", w, NULL);
>         }
>         else if (strchr(userdir, ':')) {
> !       if (userdir[strlen(userdir) - 1] == '~')
> !         /* If userdir is on a remote server and ends in '~' redirect to
> !          *  ~user on that server.  spike@indra.com 7/6/96
> !          */
> !         redirect = pstrcat(r->pool, userdir, w, dname, NULL);
> !       else
> !         redirect = pstrcat(r->pool, userdir, "/", w, dname, NULL);
>         table_set (r->headers_out, "Location", redirect);
>         return REDIRECT;
>         }
> 


--
The rumor is that Jack Kevorkian has setup a Windows-NT users group.

Mime
View raw message