href-isvalid.html (5888B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <title>valid href</title> 4 <a href="a:foo.com"></a><!-- scheme-private --> 5 <a href="foo:/"></a><!-- scheme-private-slash --> 6 <a href="foo://"></a><!-- scheme-private-slash-slash --> 7 <a href="foo:/bar.com/"></a><!-- scheme-private-path --> 8 <a href="foo://///////"></a><!-- scheme-private-path-leading-slashes-only --> 9 <a href="foo://///////bar.com/"></a><!-- scheme-private-path-leading-slashes-chars --> 10 <a href="foo:////://///"></a><!-- scheme-private-path-leading-slashes-colon-slashes --> 11 <a href="c:/foo"></a><!-- scheme-private-single-letter --> 12 <a href="madeupscheme:/example.com/"></a><!-- scheme-private-single-slash --> 13 <a href="file:/example.com/"></a><!-- scheme-file-single-slash --> 14 <a href="ftps:/example.com/"></a><!-- scheme-ftps-single-slash --> 15 <a href="gopher:/example.com/"></a><!-- scheme-gopher-single-slash --> 16 <a href="ws:/example.com/"></a><!-- scheme-ws-single-slash --> 17 <a href="wss:/example.com/"></a><!-- scheme-wss-single-slash --> 18 <a href="javascript:/example.com/"></a><!-- scheme-javascript-single-slash --> 19 <a href="mailto:/example.com/"></a><!-- scheme-mailto-single-slash --> 20 <a href="madeupscheme:example.com/"></a><!-- scheme-private-no-slash --> 21 <a href="ftps:example.com/"></a><!-- scheme-ftps-no-slash --> 22 <a href="gopher:example.com/"></a><!-- scheme-gopher-no-slash --> 23 <a href="wss:example.com/"></a><!-- scheme-wss-no-slash --> 24 <a href="mailto:example.com/"></a><!-- scheme-mailto-no-slash --> 25 <a href="data:text/plain,foo"></a><!-- scheme-data-no-slash --> 26 <a href="http://user:pass@foo:21/bar;par?b#c"></a><!-- userinfo --> 27 <a href="http://[2001::1]"></a><!-- host-ipv6 --> 28 <a href="http://[2001::1]:80"></a><!-- host-ipv6-port --> 29 <a href="http://f:/c"></a><!-- port-none-but-colon --> 30 <a href="http://f:0/c"></a><!-- port-0 --> 31 <a href="http://f:00000000000000/c"></a><!-- port-00000000000000 --> 32 <a href="http://f:00000000000000000000080/c"></a><!-- port-00000000000000000000080 --> 33 <a href="http://a:b@c:29/d"></a><!-- userinfo-host-port-path --> 34 <a href="http://foo.com:b@d/"></a><!-- userinfo-username-non-alpha --> 35 <a href="http://foo/abcd?efgh?ijkl"></a><!-- query-contains-question-mark --> 36 <a href="http://foo/abcd#foo?bar"></a><!-- fragment-contains-question-mark --> 37 <a href="http://example.com/foo/%2e"></a><!-- path-percent-encoded-dot --> 38 <a href="http://example.com/%20foo"></a><!-- path-percent-encoded-space --> 39 <a href="http://example.com/©zbar"></a><!-- path-non-ascii --> 40 <a href="http://example.com/foo%41%7a"></a><!-- path-percent-encoded-multiple --> 41 <a href="http://example.com/foo%91"></a><!-- path-percent-encoded-u0091 --> 42 <a href="http://example.com/foo%00"></a><!-- path-percent-encoded-u0000 --> 43 <a href="http://example.com/%3A%3a%3C%3c"></a><!-- path-percent-encoded-mixed-case --> 44 <a href="http://example.com/你好你好"></a><!-- path-unicode-han --> 45 <a href="http://example.com//foo"></a><!-- path-uFEFF --> 46 <a href="http://example.com//foo//bar"></a><!-- path-u202E-u202D --> 47 <a href="http://💩"></a><!-- host-is-pile-of-poo --> 48 <a href="http💩//:foo"></a><!-- path-contains-pile-of-poo --> 49 <a href="http://example.com/foo?💩"></a><!-- query-contains-pile-of-poo --> 50 <a href="http://example.com/foo#💩"></a><!-- fragment-contains-pile-of-poo --> 51 <a href="http://192.0x00A80001"></a><!-- host-192.0x00A80001 --> 52 <a href="http://%25DOMAIN:foobar@foodomain.com"></a><!-- userinfo-username-contains-percent-encoded --> 53 <a href="http://@www.example.com"></a><!-- userinfo-empty --> 54 <a href="http://:b@www.example.com"></a><!-- userinfo-user-empty --> 55 <a href="http://a:@www.example.com"></a><!-- userinfo-password-empty --> 56 <a href="http://GOOgoo.com"></a><!-- host-exotic-whitespace --> 57 <a href="http://www.foo。bar.com"></a><!-- host-exotic-dot --> 58 <a href="http://Go.com"></a><!-- host-fullwidth --> 59 <a href="http://你好你好"></a><!-- host-idn-unicode-han --> 60 <a href="http://192.168.0.257/"></a><!-- host-IP-address-broken --> 61 <a href="//foo/bar"></a><!-- scheme-schemeless-relative --> 62 <a href="/"></a><!-- path-slash-only-relative --> 63 <a href="/a/b/c"></a><!-- path-simple-relative --> 64 <a href="/a%2fc"></a><!-- path-percent-encoded-slash-relative --> 65 <a href="/a/%2f/c"></a><!-- path-percent-encoded-slash-plus-slashes-relative --> 66 <a href="?"></a><!-- query-empty-no-path-relative --> 67 <a href="#"></a><!-- fragment-empty-hash-only-no-path-relative --> 68 <a href="#/"></a><!-- fragment-slash-relative --> 69 <a href="#;?"></a><!-- fragment-semicolon-question-mark-relative --> 70 <a href="#β"></a><!-- fragment-non-ascii-relative --> 71 <a href="foo.com"></a><!-- scheme-none-relative --> 72 <a href=":"></a><!-- path-colon-relative --> 73 <a href=":a"></a><!-- path-leading-colon-letter-relative --> 74 <a href=":foo.com"></a><!-- path-leading-colon-chars-relative --> 75 <a href=":/"></a><!-- path-leading-colon-slash-relative --> 76 <a href=":#"></a><!-- path-leading-colon-hash-relative --> 77 <a href=":23"></a><!-- path-leading-colon-number-relative --> 78 <a href="/:23"></a><!-- path-slash-colon-number-relative --> 79 <a href="::"></a><!-- path-leading-colon-colon-relative --> 80 <a href="::23"></a><!-- path-colon-colon-number-relative --> 81 <a href="💩http://foo"></a><!-- path-starts-with-pile-of-poo --> 82 <a href="/💩"></a><!-- path-slash-pile-of-poo --> 83 <a href="File://foo/bar.html"></a><!-- scheme-file-uppercase --> 84 <a href="file://C|/foo/bar"></a><!-- scheme-file-slash-slash-c-bar --> 85 <a href="file://server/foo/bar"></a><!-- scheme-file-host-included --> 86 <a href="file:///foo/bar.txt"></a><!-- scheme-file-host-empty --> 87 <a href="file:"></a><!-- scheme-file-scheme-only --> 88 <a href="file:/"></a><!-- scheme-file-slash-only --> 89 <a href="file://"></a><!-- scheme-file-slash-slash-only --> 90 <a href="file:///"></a><!-- scheme-file-slash-slash-slash-only --> 91 <a href="file:test"></a><!-- scheme-file-no-slash --> 92 <a href=""></a><!-- empty-href -->