1

私は HTML ファイルtest.htmlを持っています:

<a href="http://%67oogle.com">http://%67oogle.com</a>
<br>
<a href="http://www.%67oogle.com">http://www.%67oogle.com</a>

リンクは Chrome、IExplorer、Safari、および Opera で機能します ( http://%67oogle.comはhttp://google.comを指します)。

ただし、リンクは FireFox (v13.0.1) では機能しません。

FireFox がhttp://%67oogle.comhttp://google.comにポイントしないのはなぜですか?

4

1 に答える 1

1

有効な HTTP URI は、HTTP/1.1 標準であるRFC 2616に準拠するものです。それは言います:

... For definitive information on
URL syntax and semantics, see "Uniform Resource Identifiers (URI):
Generic Syntax and Semantics," RFC 2396 [42] (which replaces RFCs
1738 [4] and RFC 1808 [11]). This specification adopts the
definitions of "URI-reference", "absoluteURI", "relativeURI", "port",
"host","abs_path", "rel_path", and "authority" from that
specification.

The "http" scheme is used to locate network resources via the HTTP
protocol. This section defines the scheme-specific syntax and
semantics for http URLs.

http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]]

RFC 2396を詳しく調べると、次のように定義hostされています。

  host          = hostname | IPv4address
  hostname      = *( domainlabel "." ) toplabel [ "." ]
  domainlabel   = alphanum | alphanum *( alphanum | "-" ) alphanum
  toplabel      = alpha | alpha *( alphanum | "-" ) alphanum

RFC 3986も見てみましょう

reg-name 構文では、パーセントでエンコードされたオクテットを使用して、基礎となる名前解決テクノロジに依存しない均一な方法で非 ASCII 登録名を表すことができます。非 ASCII 文字は最初に UTF-8 [STD63] に従ってエンコードする必要があり、次に対応する UTF-8 シーケンスの各オクテットをパーセントでエンコードして URI 文字として表す必要があります。 URI 生成アプリケーションは、UTF-8 文字シーケンスを表すために使用されない限り、ホストでパーセント エンコーディングを使用してはなりません。

したがって、Firefox がリダイレクトしないのは完全に正しいことです。%67oogle.comは URL の無効なホスト部分です。

于 2014-05-16T22:31:44.343 に答える