tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: VIS_HTTPSTYLE



    Date:        Mon, 23 Nov 2009 11:08:18 +0000 (GMT)
    From:        Iain Hibbert <plunky%rya-online.net@localhost>
    Message-ID:  <1258974498.224950.1189.nullmailer%galant.ukfsn.org@localhost>

  | Yeah, but if it matched any of the chars in the string, it specifically
  | encoded them which was not the intention.. logic was reversed

Yes, !a || b is not the same as !(a || b) which is what it
should have been...

  | I thought about this but think its too confusing, and all that negativity
  | was getting me down.

Fine - I see that you committed the change while I was typing
my message.

  | I think the code could use a fairly major rethink. For example, even with
  | my change we get
  | 
  | ORIG: http://www.netbsd.org/
  | HTTP: http%3a%2f%2fwww.netbsd.org%2f

Hmm - never considered that, I expect that only the path part of a
URL is intended to be passed to these functions, not the whole thing.

  | Which I'm not sure is right.. and for example then in this
  | 
  | ORIG: http://www.netbsd.org/~plunky/Some File
  | HTTP: http%3a%2f%2fwww.netbsd.org%2f%7eplunky%2fSome%20File

The slashes are bad, I think that's another bug, / is permitted in URLs...
(They're just in a different place in the RFC because of their other
meanings).

  | My overall thought is that an URL should be able to be passed through
  | vis() and copy-pasted to the address bar in a browser or shell commandline
  | for wget or ftp. The VIS_HTTPSTYLE came from FreeBSD originally though so
  | I guess the original design intention needs to be discovered..

If that was the intended usage, then chars like ( ) ' $ (etc) would not be
in the "don't encode" set - instead, and given the underlying support for
the chars chosen comes from the RFCs, my assumption would have been that
the intent is to take a raw path part of a URL (what 1808 calls a rel-path
or an abs-path) and put in a form that's safe to stick in an HTTP GET
command arg (or one of the others) - so clearly a space needs to be
encoded, or it would end the path arg to the GET command, but in that
context, stuff like $ ' () (etc) have no special meaning and are safe as
they are.

Who or what actually uses this function (with the HTTPVIS flag set) ?
Is there a client?

kre


Home | Main Index | Thread Index | Old Index