Tuesday, August 5, 2008

原来RFC规定url是不准带下划线的。

今天想在tencent的网站下载一个foxmail,发觉打开连接失败,提示如下:

ERROR

The requested URL could not be retrieved


While trying to retrieve the URL: http://dl_dir.qq.com/foxmail/foxmail65beta02.exe

The following error was encountered:

  • Invalid URL

Some aspect of the requested URL is incorrect. Possible problems:

  • Missing or incorrect access protocol (should be `http://'' or similar)
  • Missing hostname
  • Illegal double-escape in the URL-Path
  • Illegal character in hostname; underscores are not allowed

Your cache administrator is sysadm@cse.cuhk.edu.hk.


Generated Tue, 05 Aug 2008 14:17:54 GMT by pluto.cse.cuhk.edu.hk (squid/2.5.STABLE12)

仔细看,似乎是因为underscore的问题。

网上搜得出了这个答案:

出错的原因是你提到的这个域名有一个不称职的管理员。

RFC 1034中明确指出:

代码:

The following syntax will result in fewer problems with many applications that use domain names (e.g., mail, TELNET).

<domain> ::= <subdomain> | " "

<subdomain> ::= <label> | <subdomain> "." <label>

<label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]

<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>

<let-dig-hyp> ::= <let-dig> | "-"

<let-dig> ::= <letter> | <digit>

<letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case

<digit> ::= any one of the ten digits 0 through 9


下划线有保留意义,不能随意使用。

引自:http://www.freebsdchina.org/forum/viewtopic.php?=&p=188440
据说是squid的问题。

No comments: