Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: problems with url...

From: rotenca:telvia:it at: 19-Jun-2002 15:52

Hi Ingo, Joel, Cyphre I think the problem is in Load, which interprets %xx and trasform it in a char. But net-utils/url-parser/parse-url which is called by decode-url expects that the url confomsitself to the RFC. Ingo, What are the two place in which code is badly escaped? I can think only of Load (and do which internally call Load with string, file ...) Cyphre, about proxy error, it is not exactly the same, because Load do not change (i try to explain this at the end), it escape it correctly. The log message "The URL Parse: ..." is correct, this should mean that url has been decoded in the exact mode. Joel,
>Notice that the message is > User Error: URL error: ...
This is the result of the function: net-utils/url-parser/parse-url/no-error
>and not > Syntax Error: Invalid url ...
This is a Load error message.
>implying to my eye that LOAD was happy
Yes
> but the result wasn't usable by READ.
because of decode-url, which makes the right thing, is Load which happy fails :-)
>When I say something like > >> gorp: "http://%77%77%77.rebol%2ecom/" > == "http://%77%77%77.rebol%2ecom/" > >> load gorp > == http://www.rebol.com/ >LOAD seems to want to unescape the string. That's OK in this case, >since all of the escaped characters are actually valid in URLs,
I think it is not correct, because Load could be unaware of some legal custom rules valid for some existing (and not existing) url. Reading the RFC, I understand that almost all chars in an URL could be escaped, i do not understand why Load should change this. It produces only a more readable url (sometimes invalid). That could be made by a function like Form not by Load.
>the (premature) unescaping of "%C8" back to the high-bit-on accented-E >character may be the source of grief when that literal character is >deemed invalid for use in a URL.
Yes. I think that the bug arise from the fact that RT use the same code for Loading a file and Loading an url, but this ends sometimes with uncorrected url:
>> load "% " ;== % >> load "ftp:// " ;== ftp:// >> load "%%22" ;== %%22 >> load "ftp://%22" ;== ftp://%22 >> load "%%C8" ;== %È >> load "ftp://%C8" ;== ftp://È
--- Ciao Romano