httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <>
Subject Re: SCRIPT_NAME bug (was Re: module status)
Date Mon, 05 Aug 1996 16:39:25 GMT
On Mon, 5 Aug 1996, Ralf S. Engelschall wrote:

> Hmmm... sounds ok, but I'm not 100% sure if is really correct.  But I think
> it is correct for the cases we discovered the problems.  I hope we not
> introduce new problems.

I believe the *best* way to do this, although rather complex, is as

1) Take r->uri and r->path_info. Match the tails of the two string

2) Take the matching part, and divide r->uri at that point. Advance to the
next "/" (or don't advance if the last matching character is a "/", or go
to the end of the string if there are no "/" after the matching point). 
Make the part of r->uri prior to the "/" SCRIPT_NAME, the rest PATH_INFO.

3) Translate PATH_TRANSLATED from r->path_info as normal.

This satisfies the one requirement that your solution doesn't - that the
user be able to modify PATH_INFO by tacking stuff on to the end of the URL
they access.

I'll try and code this up later today. Unfortunately, there isn't a
standard C function that matches the tails of strings.

-- Alexei Kosut <>            The Apache HTTP Server

View raw message