Re: url-encoding for http addresses



Hi,

Am Dienstag, den 07.12.2004, 21:47 -0500 schrieb Walter Landry: 
> Alexander Larsson <alexl redhat com> wrote:
> > On Mon, 2004-12-06 at 20:38 -0500, Walter Landry wrote:
> > > Hello,
> > > 
> > > I just upgraded gnome-vfs2 on my Debian testing machine from 2.6.2 to
> > > 2.8.3, and it seems that the default interpretation of http uri's has
> > > changed.  In 2.6, gnome-vfs2 breaks if you don't url-encode any http
> > > uri's you give it.  In 2.8, it breaks if you do.

eeek!

> > > 
> > > First of all, is this change documented anywhere?  Second, is there a
> > > simple way to check for versions so that I can write code that will
> > > work with both the old and new conventions?
> > 
> > Hmm. This sounds bad. You mean that passing in a string containing "%20"
> > breaks, but one with a space in doesn't?
> 
> With 2.8, correct.
> 
> > That seems wrong, the gnome-vfs semantics should be that uris always
> > have to be escaped.
(1 --^)

> 
> But then you have to have special code in your application to escape
> only http uri's.  You might as well let gnome-vfs do it for itself.

Huh? No, after (1) is met, you'd have to hold every uri escaped, http
and file and whatever.

Why should gnome-vfs escape stuff? It should leave the uri as is. keep
it simple :) Else there will be a escape-unescape-escape or
escape-escape-unescape-unescape or isescaped?unescape:normal mess.
Waaah :)

Better is that uri means uri-escaped too. Gnome vfs takes an uri which
means it must be uri escaped already. Else it would not be an uri.

You can create a guess_uri_by_user_input function in an extra lib
though, since that is what it most probably will boil down to, eeew.
Everyone will need that for "correcting" (for better or for worse) gui
input when the following should work:

original uri: http://www.blah.com/some%20test
user adds: /some file.png
entry contains: http://www.blah.com/some%20test/some file.png

guess_uri_by_user_input would correct it to be:
http://www.blah.com/some%20test/some%20file.png

(although there are less and less places in gnome where the uri is
visible, it still needs to be corrected internally, for example for
merging relative paths)

With the corner case of what to do if some file on the http server is
really called "%20bla.png" (on the filesystem itself). There are files
like that out there.

Because if entry contains: http://www.blah.com/some%20test/some file.png
it is obvious that it is not completely escaped
Because if entry contains: http://www.blah.com/some%20test/%20bla.png
it is *not* obvious that it is not completely escaped in our example
here.

cheers,
   Danny

-- 
www.keyserver.net key id A334AEA6

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]