less string URL parsing...

Thiago Macieira thiago.macieira at kdemail.net
Fri Dec 3 12:19:59 GMT 2004


Jason McLaughlin wrote:
>I'm developing a proxy server (www.safesquid.com) that has a feature
> that allows users to prefix a hostname with a command followed by two
> periods (i.e. http://cache..www.yahoo.com) to temporarily change proxy
> settings, bypass filtering features, view file information, etc... It's
> been a pretty useful feature.

It looks to me to be an invalid domain name.

>Would I be able to convince you guys to allow them? Konqueror's the only
> browser I use, and I really miss being able to use this feature :)

I'd rather not add this, as it looks to me like invalid behaviour.

Waldo Bastian said:
>The international domain name support barfs on it as being an invalid
>domain name. Will handle that situation a bit more gracefully for KDE 3.4 

Quoting from RFC 3490 (section 4.1):

   It is important to note that the ToASCII operation can fail.  ToASCII
   fails if any step of it fails.  If any step of the ToASCII operation
   fails on any label in a domain name, that domain name MUST NOT be
   used as an internationalized domain name.  The method for dealing
   with this failure is application-specific.

and step 8:

   8. Verify that the number of code points is in the range 1 to 63
      inclusive.

That's why you get errors: because 0 is not a valid length for ToASCII. 
That means that the domain label is invalid and the whole domain name may 
not be used as an IDN.

If we were to follow instructions to the letter, we could still use the 
domain name, as long as it's not used as an IDN.

Jason McLaughlin wrote:
>Or could someone suggest another scheme I can maybe use? Nothing else
>comes to mind that would work as well as the way I have it. 

There are other ways of specifying hostnames that are currently not 
allowed. We don't enforce the STD 3 restrictions in hostnames, which 
means you can use a label that starts or ends with a dash (-), like:

http://-cache-.www.yahoo.com

But also note that programs are selectively allowed to enforce STD3 if 
they wish to.

Another solution, which wouldn't involve using maybe-not-allowed domain 
names, is to use a top-level domain name:

http://www.yahoo.com.cache.

(The extra ending dot is not necessary and currently makes no difference. 
See bug #93008)

In all, I think your way out is to use a name that doesn't exist and will 
never exist, instead of using names that are not allowed to exist.
-- 
  Thiago Macieira  -  Registered Linux user #65028
   thiago (AT) macieira (DOT) info
    ICQ UIN: 1967141   PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20041203/fb6d1212/attachment.sig>


More information about the kfm-devel mailing list