On 03/12/14 22:35, ropers wrote:
> On 13 March 2014 00:23, Maurice McCarthy wrote:
>> On the typo http://[url snipped]/faq//faq1.html an extra "faq/" is placed ...
>> where it should not be.
> 
> It isn't really *placed*.
> 
> If you look at the HTML source, you'll see that the links that (only)
> *seem* to be "acting up" in connection with the mistyped URL are just
> ordinary relative links; e.g.:
> 
> | Our
> | <a href="../goals.html">goals</a> place emphasis on correctness,
> | <a href="../security.html">security</a>, standardization, and
> | <a href="../plat.html">portability</a>.
> 
> It's just that your browser (and my Firefox) seems to --in this context
> at least-- interpret the "//" as an extra level in the hierarchy, so
> the "start from www.openbsd.org/faq/ and go one level up to reach
> www.openbsd.org/" seems to become "start from www.openbsd.org/faq//
> and go one level up to reach www.openbsd.org/faq/" (which doesn't have
> e.g. a goals.html).
> 
> The inconsistency arises because on the one hand, the "//" is accepted
> as equivalent to "/" (which is why you're getting a page at all with
> the mistyped URL), but then on the other hand, the "//" is parsed as
> two hierarchy levels.
> So "//" counts as 1 on the way *down* the hierarchy, but it counts as
> 2 on the way back *up*.

not exactly.

ok, you go to ...faq//faq1.html
The OS on the webserver takes you to [htmldocs]/faq//faq1.html.  OpenBSD
(and I believe most unix-like OSs) ignores the extra slash.

...but your browser doesn't.

So...when you click on <a href="../goals.html">goals</a> your browser
lops off one slash and submits a url to the server --
   http://.../faq/goals.html
which is wrong.

> I'm not actually sure if this behaviour is canonical, and/or whether
> it's a bug or not, either in Firefox or (also) in the HTTPD. To my
> naive mind making assumptions that are based on bugger all, the "//"
> ought to take you back to the root, but I haven't read the RFC/spec.
> Maybe someone else knows this off the top of their head?
> 
> regards,
> --ropers
> 
> PS: Okay, so I have at least skimmed parts of
> https://tools.ietf.org/html/rfc3986#section-3 - but specifically as
> the question how //s ought to be treated, I'm none the wiser.
> Apparently the only place the RFC really envisages //s is in front of
> the authority (domain name part), i.e.after http: or similar. But then
> the RFC doesn't strictly say that //s were illegal in any other place.
> If anyone else knows this, I'd be much obliged for cluebat
> ministrations.

It is really much simpler than that.

The OP's URL is *WRONG*. Plain and simple.  It shouldn't be on the
OpenBSD website at all, and it shouldn't be elsewhere, either.  It
shouldn't have been submitted to the OpenBSD web servers with the
expectation of success.  The fact that the web server returned something
looking useful has to do with what the underlying OS does with double
slashes -- just ignores them, but it isn't required/desired/whatever.
It is entirely possible to write a web server which would do something
totally different with double slashes.

So..the fact that relative links against an incorrect URL don't work is
not really an issue.  If there's an issue here (and I don't believe
there is), maybe the webserver should have 404'd on the initial URL.

(I saw a discussion recently where the idea came up of increasing
donations by by changing 404 errors to 402.  Yeah, I had to look it up,
too.  So I expect everyone who participates in this thread WILL be
buying a CD set soon. :)

Nick.

Reply via email to