Mailing List Archive

Sloppy URLs (was Re: double slashes)
> RST: THERE IS A BUG. Apache is NOT compatible with NCSA httpd in this
> respect.
>
>No there is not --- NCSA 1.3 handles Alias comparisons the same way as
>the current 0.8.16 code --- by straight comparison with initial substrings.

Ooops; you are correct; I was wrong.

>The "ban //" hack is the one which *introduces* an incompatibility, which
>is the reason I am dead set to veto it.

Well, I still think the Apache (and NCSA) behaviour is pretty poor, and
that banning "//" would make it easier for users. Another example of lossage:

If you have a server-side include script which uses relative links,
then the client can get your script to include a different file.

e.g.
URL: /foo/bar/inc.shtml
<!--#include virtual="../somedoc.html"-->

If the client requests /foo/bar//inc.shtml, then
/foo/bar/somedoc.html is included, instead of /foo/somedoc.html

Apache 0.6.5 got this right.

If you don't like banning //, then how about issuing a redirect to the URL
without // ? (Until we can send a Base: header with HTTP/1.1)

David.
Re: Sloppy URLs (was Re: double slashes) [ In reply to ]
If you don't like banning //, then how about issuing a redirect to the URL
without // ? (Until we can send a Base: header with HTTP/1.1)

I see no compelling reason to make such a change. It *might* be a useful
cleanup (I'd have to consider the issue much further, to be sure there aren't
any nasty gotchas), but it can *certainly* wait till after 1.0.

rst
Re: Sloppy URLs (was Re: double slashes) [ In reply to ]
> >The "ban //" hack is the one which *introduces* an incompatibility, which
> >is the reason I am dead set to veto it.
>
> Well, I still think the Apache (and NCSA) behaviour is pretty poor, and
> that banning "//" would make it easier for users. Another example of lossage:

I'll toss something else into the pot. Just read it as FYI not as
an argument for how we should deal with //
I've come across a *browser* which squeezes consequtive "/"s in URLs
it reads in HTML (expcept for the first // of course :-). The browser?,
OmniWeb - a NeXT client.

rob
Re: Sloppy URLs (was Re: double slashes) [ In reply to ]
URL: /foo/bar/inc.shtml
<!--#include virtual="../somedoc.html"-->

I don't see why sending redirects is necessary to handle this properly;
it's far easier for everybody to just handle it right in getparents().
That's also less work for the client, and you don't have to worry about
the possibility of setting up redirect loops. Here is a *very* simple
patch which does the job:

*** util.c.prepatch Mon Nov 6 12:16:48 1995
--- util.c Wed Nov 8 10:06:55 1995
***************
*** 203,208 ****
--- 203,209 ----

l=l-3;
if(l>=0) {
+ while((l!=0) && (name[l]=='/')) --l;
while((l!=0) && (name[l]!='/')) --l;
}
else l=0;