tech-userlevel archive

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

Re: VIS_HTTPSTYLE



On Mon, 23 Nov 2009, Iain Hibbert wrote:
> 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
> 
> 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

I think the above examples are correct.  Escaping the slashes is
necessary for uses like this:

        http://redirect.example/?target=http%3a%2f%2fwww.netbsd.org%2f

Maybe vis could take some extra flags to provider finer control?
For example, I have a "quote" command, which takes -x and -X options
to add or remove characters from the list of things to be escaped:

$ quote -t url 'http://www.netbsd.org/~plunky/Some File'
http%3A%2F%2Fwww.netbsd.org%2F~plunky%2FSome%20File
$ quote -t urlquery 'http://www.netbsd.org/~plunky/Some File'
http%3A%2F%2Fwww.netbsd.org%2F~plunky%2FSome+File
$ quote -t url -X / 'http://www.netbsd.org/~plunky/Some File'
http%3A//www.netbsd.org/~plunky/Some%20File
$ quote -t url -X / -x '~' 'http://www.netbsd.org/~plunky/Some File'
http%3A//www.netbsd.org/%7Eplunky/Some%20File

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index