PageRenderTime 82ms CodeModel.GetById 34ms RepoModel.GetById 0ms app.codeStats 0ms

/netwerk/test/gtest/urltestdata-orig.json

https://bitbucket.org/vionika/spin.android
JSON | 6148 lines | 6148 code | 0 blank | 0 comment | 0 complexity | 76a52734ad41ea49eca4991b6311f64a MD5 | raw file
Possible License(s): JSON, 0BSD, AGPL-1.0, BSD-2-Clause, GPL-3.0, LGPL-2.1, LGPL-3.0, CC0-1.0, AGPL-3.0, MPL-2.0, Apache-2.0, MIT, BSD-3-Clause, MPL-2.0-no-copyleft-exception, GPL-2.0, Unlicense
  1. [
  2. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js",
  3. {
  4. "input": "http://example\t.\norg",
  5. "base": "http://example.org/foo/bar",
  6. "href": "http://example.org/",
  7. "origin": "http://example.org",
  8. "protocol": "http:",
  9. "username": "",
  10. "password": "",
  11. "host": "example.org",
  12. "hostname": "example.org",
  13. "port": "",
  14. "pathname": "/",
  15. "search": "",
  16. "hash": ""
  17. },
  18. {
  19. "input": "http://user:pass@foo:21/bar;par?b#c",
  20. "base": "http://example.org/foo/bar",
  21. "href": "http://user:pass@foo:21/bar;par?b#c",
  22. "origin": "http://foo:21",
  23. "protocol": "http:",
  24. "username": "user",
  25. "password": "pass",
  26. "host": "foo:21",
  27. "hostname": "foo",
  28. "port": "21",
  29. "pathname": "/bar;par",
  30. "search": "?b",
  31. "hash": "#c"
  32. },
  33. {
  34. "input": "https://test:@test",
  35. "base": "about:blank",
  36. "href": "https://test@test/",
  37. "origin": "https://test",
  38. "protocol": "https:",
  39. "username": "test",
  40. "password": "",
  41. "host": "test",
  42. "hostname": "test",
  43. "port": "",
  44. "pathname": "/",
  45. "search": "",
  46. "hash": ""
  47. },
  48. {
  49. "input": "https://:@test",
  50. "base": "about:blank",
  51. "href": "https://test/",
  52. "origin": "https://test",
  53. "protocol": "https:",
  54. "username": "",
  55. "password": "",
  56. "host": "test",
  57. "hostname": "test",
  58. "port": "",
  59. "pathname": "/",
  60. "search": "",
  61. "hash": ""
  62. },
  63. {
  64. "input": "non-special://test:@test/x",
  65. "base": "about:blank",
  66. "href": "non-special://test@test/x",
  67. "origin": "null",
  68. "protocol": "non-special:",
  69. "username": "test",
  70. "password": "",
  71. "host": "test",
  72. "hostname": "test",
  73. "port": "",
  74. "pathname": "/x",
  75. "search": "",
  76. "hash": ""
  77. },
  78. {
  79. "input": "non-special://:@test/x",
  80. "base": "about:blank",
  81. "href": "non-special://test/x",
  82. "origin": "null",
  83. "protocol": "non-special:",
  84. "username": "",
  85. "password": "",
  86. "host": "test",
  87. "hostname": "test",
  88. "port": "",
  89. "pathname": "/x",
  90. "search": "",
  91. "hash": ""
  92. },
  93. {
  94. "input": "http:foo.com",
  95. "base": "http://example.org/foo/bar",
  96. "href": "http://example.org/foo/foo.com",
  97. "origin": "http://example.org",
  98. "protocol": "http:",
  99. "username": "",
  100. "password": "",
  101. "host": "example.org",
  102. "hostname": "example.org",
  103. "port": "",
  104. "pathname": "/foo/foo.com",
  105. "search": "",
  106. "hash": ""
  107. },
  108. {
  109. "input": "\t :foo.com \n",
  110. "base": "http://example.org/foo/bar",
  111. "href": "http://example.org/foo/:foo.com",
  112. "origin": "http://example.org",
  113. "protocol": "http:",
  114. "username": "",
  115. "password": "",
  116. "host": "example.org",
  117. "hostname": "example.org",
  118. "port": "",
  119. "pathname": "/foo/:foo.com",
  120. "search": "",
  121. "hash": ""
  122. },
  123. {
  124. "input": " foo.com ",
  125. "base": "http://example.org/foo/bar",
  126. "href": "http://example.org/foo/foo.com",
  127. "origin": "http://example.org",
  128. "protocol": "http:",
  129. "username": "",
  130. "password": "",
  131. "host": "example.org",
  132. "hostname": "example.org",
  133. "port": "",
  134. "pathname": "/foo/foo.com",
  135. "search": "",
  136. "hash": ""
  137. },
  138. {
  139. "input": "a:\t foo.com",
  140. "base": "http://example.org/foo/bar",
  141. "href": "a: foo.com",
  142. "origin": "null",
  143. "protocol": "a:",
  144. "username": "",
  145. "password": "",
  146. "host": "",
  147. "hostname": "",
  148. "port": "",
  149. "pathname": " foo.com",
  150. "search": "",
  151. "hash": ""
  152. },
  153. {
  154. "input": "http://f:21/ b ? d # e ",
  155. "base": "http://example.org/foo/bar",
  156. "href": "http://f:21/%20b%20?%20d%20# e",
  157. "origin": "http://f:21",
  158. "protocol": "http:",
  159. "username": "",
  160. "password": "",
  161. "host": "f:21",
  162. "hostname": "f",
  163. "port": "21",
  164. "pathname": "/%20b%20",
  165. "search": "?%20d%20",
  166. "hash": "# e"
  167. },
  168. {
  169. "input": "lolscheme:x x#x x",
  170. "base": "about:blank",
  171. "href": "lolscheme:x x#x x",
  172. "protocol": "lolscheme:",
  173. "username": "",
  174. "password": "",
  175. "host": "",
  176. "hostname": "",
  177. "port": "",
  178. "pathname": "x x",
  179. "search": "",
  180. "hash": "#x x"
  181. },
  182. {
  183. "input": "http://f:/c",
  184. "base": "http://example.org/foo/bar",
  185. "href": "http://f/c",
  186. "origin": "http://f",
  187. "protocol": "http:",
  188. "username": "",
  189. "password": "",
  190. "host": "f",
  191. "hostname": "f",
  192. "port": "",
  193. "pathname": "/c",
  194. "search": "",
  195. "hash": ""
  196. },
  197. {
  198. "input": "http://f:0/c",
  199. "base": "http://example.org/foo/bar",
  200. "href": "http://f:0/c",
  201. "origin": "http://f:0",
  202. "protocol": "http:",
  203. "username": "",
  204. "password": "",
  205. "host": "f:0",
  206. "hostname": "f",
  207. "port": "0",
  208. "pathname": "/c",
  209. "search": "",
  210. "hash": ""
  211. },
  212. {
  213. "input": "http://f:00000000000000/c",
  214. "base": "http://example.org/foo/bar",
  215. "href": "http://f:0/c",
  216. "origin": "http://f:0",
  217. "protocol": "http:",
  218. "username": "",
  219. "password": "",
  220. "host": "f:0",
  221. "hostname": "f",
  222. "port": "0",
  223. "pathname": "/c",
  224. "search": "",
  225. "hash": ""
  226. },
  227. {
  228. "input": "http://f:00000000000000000000080/c",
  229. "base": "http://example.org/foo/bar",
  230. "href": "http://f/c",
  231. "origin": "http://f",
  232. "protocol": "http:",
  233. "username": "",
  234. "password": "",
  235. "host": "f",
  236. "hostname": "f",
  237. "port": "",
  238. "pathname": "/c",
  239. "search": "",
  240. "hash": ""
  241. },
  242. {
  243. "input": "http://f:b/c",
  244. "base": "http://example.org/foo/bar",
  245. "failure": true
  246. },
  247. {
  248. "input": "http://f: /c",
  249. "base": "http://example.org/foo/bar",
  250. "failure": true
  251. },
  252. {
  253. "input": "http://f:\n/c",
  254. "base": "http://example.org/foo/bar",
  255. "href": "http://f/c",
  256. "origin": "http://f",
  257. "protocol": "http:",
  258. "username": "",
  259. "password": "",
  260. "host": "f",
  261. "hostname": "f",
  262. "port": "",
  263. "pathname": "/c",
  264. "search": "",
  265. "hash": ""
  266. },
  267. {
  268. "input": "http://f:fifty-two/c",
  269. "base": "http://example.org/foo/bar",
  270. "failure": true
  271. },
  272. {
  273. "input": "http://f:999999/c",
  274. "base": "http://example.org/foo/bar",
  275. "failure": true
  276. },
  277. {
  278. "input": "non-special://f:999999/c",
  279. "base": "http://example.org/foo/bar",
  280. "failure": true
  281. },
  282. {
  283. "input": "http://f: 21 / b ? d # e ",
  284. "base": "http://example.org/foo/bar",
  285. "failure": true
  286. },
  287. {
  288. "input": "",
  289. "base": "http://example.org/foo/bar",
  290. "href": "http://example.org/foo/bar",
  291. "origin": "http://example.org",
  292. "protocol": "http:",
  293. "username": "",
  294. "password": "",
  295. "host": "example.org",
  296. "hostname": "example.org",
  297. "port": "",
  298. "pathname": "/foo/bar",
  299. "search": "",
  300. "hash": ""
  301. },
  302. {
  303. "input": " \t",
  304. "base": "http://example.org/foo/bar",
  305. "href": "http://example.org/foo/bar",
  306. "origin": "http://example.org",
  307. "protocol": "http:",
  308. "username": "",
  309. "password": "",
  310. "host": "example.org",
  311. "hostname": "example.org",
  312. "port": "",
  313. "pathname": "/foo/bar",
  314. "search": "",
  315. "hash": ""
  316. },
  317. {
  318. "input": ":foo.com/",
  319. "base": "http://example.org/foo/bar",
  320. "href": "http://example.org/foo/:foo.com/",
  321. "origin": "http://example.org",
  322. "protocol": "http:",
  323. "username": "",
  324. "password": "",
  325. "host": "example.org",
  326. "hostname": "example.org",
  327. "port": "",
  328. "pathname": "/foo/:foo.com/",
  329. "search": "",
  330. "hash": ""
  331. },
  332. {
  333. "input": ":foo.com\\",
  334. "base": "http://example.org/foo/bar",
  335. "href": "http://example.org/foo/:foo.com/",
  336. "origin": "http://example.org",
  337. "protocol": "http:",
  338. "username": "",
  339. "password": "",
  340. "host": "example.org",
  341. "hostname": "example.org",
  342. "port": "",
  343. "pathname": "/foo/:foo.com/",
  344. "search": "",
  345. "hash": ""
  346. },
  347. {
  348. "input": ":",
  349. "base": "http://example.org/foo/bar",
  350. "href": "http://example.org/foo/:",
  351. "origin": "http://example.org",
  352. "protocol": "http:",
  353. "username": "",
  354. "password": "",
  355. "host": "example.org",
  356. "hostname": "example.org",
  357. "port": "",
  358. "pathname": "/foo/:",
  359. "search": "",
  360. "hash": ""
  361. },
  362. {
  363. "input": ":a",
  364. "base": "http://example.org/foo/bar",
  365. "href": "http://example.org/foo/:a",
  366. "origin": "http://example.org",
  367. "protocol": "http:",
  368. "username": "",
  369. "password": "",
  370. "host": "example.org",
  371. "hostname": "example.org",
  372. "port": "",
  373. "pathname": "/foo/:a",
  374. "search": "",
  375. "hash": ""
  376. },
  377. {
  378. "input": ":/",
  379. "base": "http://example.org/foo/bar",
  380. "href": "http://example.org/foo/:/",
  381. "origin": "http://example.org",
  382. "protocol": "http:",
  383. "username": "",
  384. "password": "",
  385. "host": "example.org",
  386. "hostname": "example.org",
  387. "port": "",
  388. "pathname": "/foo/:/",
  389. "search": "",
  390. "hash": ""
  391. },
  392. {
  393. "input": ":\\",
  394. "base": "http://example.org/foo/bar",
  395. "href": "http://example.org/foo/:/",
  396. "origin": "http://example.org",
  397. "protocol": "http:",
  398. "username": "",
  399. "password": "",
  400. "host": "example.org",
  401. "hostname": "example.org",
  402. "port": "",
  403. "pathname": "/foo/:/",
  404. "search": "",
  405. "hash": ""
  406. },
  407. {
  408. "input": ":#",
  409. "base": "http://example.org/foo/bar",
  410. "href": "http://example.org/foo/:#",
  411. "origin": "http://example.org",
  412. "protocol": "http:",
  413. "username": "",
  414. "password": "",
  415. "host": "example.org",
  416. "hostname": "example.org",
  417. "port": "",
  418. "pathname": "/foo/:",
  419. "search": "",
  420. "hash": ""
  421. },
  422. {
  423. "input": "#",
  424. "base": "http://example.org/foo/bar",
  425. "href": "http://example.org/foo/bar#",
  426. "origin": "http://example.org",
  427. "protocol": "http:",
  428. "username": "",
  429. "password": "",
  430. "host": "example.org",
  431. "hostname": "example.org",
  432. "port": "",
  433. "pathname": "/foo/bar",
  434. "search": "",
  435. "hash": ""
  436. },
  437. {
  438. "input": "#/",
  439. "base": "http://example.org/foo/bar",
  440. "href": "http://example.org/foo/bar#/",
  441. "origin": "http://example.org",
  442. "protocol": "http:",
  443. "username": "",
  444. "password": "",
  445. "host": "example.org",
  446. "hostname": "example.org",
  447. "port": "",
  448. "pathname": "/foo/bar",
  449. "search": "",
  450. "hash": "#/"
  451. },
  452. {
  453. "input": "#\\",
  454. "base": "http://example.org/foo/bar",
  455. "href": "http://example.org/foo/bar#\\",
  456. "origin": "http://example.org",
  457. "protocol": "http:",
  458. "username": "",
  459. "password": "",
  460. "host": "example.org",
  461. "hostname": "example.org",
  462. "port": "",
  463. "pathname": "/foo/bar",
  464. "search": "",
  465. "hash": "#\\"
  466. },
  467. {
  468. "input": "#;?",
  469. "base": "http://example.org/foo/bar",
  470. "href": "http://example.org/foo/bar#;?",
  471. "origin": "http://example.org",
  472. "protocol": "http:",
  473. "username": "",
  474. "password": "",
  475. "host": "example.org",
  476. "hostname": "example.org",
  477. "port": "",
  478. "pathname": "/foo/bar",
  479. "search": "",
  480. "hash": "#;?"
  481. },
  482. {
  483. "input": "?",
  484. "base": "http://example.org/foo/bar",
  485. "href": "http://example.org/foo/bar?",
  486. "origin": "http://example.org",
  487. "protocol": "http:",
  488. "username": "",
  489. "password": "",
  490. "host": "example.org",
  491. "hostname": "example.org",
  492. "port": "",
  493. "pathname": "/foo/bar",
  494. "search": "",
  495. "hash": ""
  496. },
  497. {
  498. "input": "/",
  499. "base": "http://example.org/foo/bar",
  500. "href": "http://example.org/",
  501. "origin": "http://example.org",
  502. "protocol": "http:",
  503. "username": "",
  504. "password": "",
  505. "host": "example.org",
  506. "hostname": "example.org",
  507. "port": "",
  508. "pathname": "/",
  509. "search": "",
  510. "hash": ""
  511. },
  512. {
  513. "input": ":23",
  514. "base": "http://example.org/foo/bar",
  515. "href": "http://example.org/foo/:23",
  516. "origin": "http://example.org",
  517. "protocol": "http:",
  518. "username": "",
  519. "password": "",
  520. "host": "example.org",
  521. "hostname": "example.org",
  522. "port": "",
  523. "pathname": "/foo/:23",
  524. "search": "",
  525. "hash": ""
  526. },
  527. {
  528. "input": "/:23",
  529. "base": "http://example.org/foo/bar",
  530. "href": "http://example.org/:23",
  531. "origin": "http://example.org",
  532. "protocol": "http:",
  533. "username": "",
  534. "password": "",
  535. "host": "example.org",
  536. "hostname": "example.org",
  537. "port": "",
  538. "pathname": "/:23",
  539. "search": "",
  540. "hash": ""
  541. },
  542. {
  543. "input": "::",
  544. "base": "http://example.org/foo/bar",
  545. "href": "http://example.org/foo/::",
  546. "origin": "http://example.org",
  547. "protocol": "http:",
  548. "username": "",
  549. "password": "",
  550. "host": "example.org",
  551. "hostname": "example.org",
  552. "port": "",
  553. "pathname": "/foo/::",
  554. "search": "",
  555. "hash": ""
  556. },
  557. {
  558. "input": "::23",
  559. "base": "http://example.org/foo/bar",
  560. "href": "http://example.org/foo/::23",
  561. "origin": "http://example.org",
  562. "protocol": "http:",
  563. "username": "",
  564. "password": "",
  565. "host": "example.org",
  566. "hostname": "example.org",
  567. "port": "",
  568. "pathname": "/foo/::23",
  569. "search": "",
  570. "hash": ""
  571. },
  572. {
  573. "input": "foo://",
  574. "base": "http://example.org/foo/bar",
  575. "href": "foo:///",
  576. "origin": "null",
  577. "protocol": "foo:",
  578. "username": "",
  579. "password": "",
  580. "host": "",
  581. "hostname": "",
  582. "port": "",
  583. "pathname": "/",
  584. "search": "",
  585. "hash": ""
  586. },
  587. {
  588. "input": "http://a:b@c:29/d",
  589. "base": "http://example.org/foo/bar",
  590. "href": "http://a:b@c:29/d",
  591. "origin": "http://c:29",
  592. "protocol": "http:",
  593. "username": "a",
  594. "password": "b",
  595. "host": "c:29",
  596. "hostname": "c",
  597. "port": "29",
  598. "pathname": "/d",
  599. "search": "",
  600. "hash": ""
  601. },
  602. {
  603. "input": "http::@c:29",
  604. "base": "http://example.org/foo/bar",
  605. "href": "http://example.org/foo/:@c:29",
  606. "origin": "http://example.org",
  607. "protocol": "http:",
  608. "username": "",
  609. "password": "",
  610. "host": "example.org",
  611. "hostname": "example.org",
  612. "port": "",
  613. "pathname": "/foo/:@c:29",
  614. "search": "",
  615. "hash": ""
  616. },
  617. {
  618. "input": "http://&a:foo(b]c@d:2/",
  619. "base": "http://example.org/foo/bar",
  620. "href": "http://&a:foo(b%5Dc@d:2/",
  621. "origin": "http://d:2",
  622. "protocol": "http:",
  623. "username": "&a",
  624. "password": "foo(b%5Dc",
  625. "host": "d:2",
  626. "hostname": "d",
  627. "port": "2",
  628. "pathname": "/",
  629. "search": "",
  630. "hash": ""
  631. },
  632. {
  633. "input": "http://::@c@d:2",
  634. "base": "http://example.org/foo/bar",
  635. "href": "http://:%3A%40c@d:2/",
  636. "origin": "http://d:2",
  637. "protocol": "http:",
  638. "username": "",
  639. "password": "%3A%40c",
  640. "host": "d:2",
  641. "hostname": "d",
  642. "port": "2",
  643. "pathname": "/",
  644. "search": "",
  645. "hash": ""
  646. },
  647. {
  648. "input": "http://foo.com:b@d/",
  649. "base": "http://example.org/foo/bar",
  650. "href": "http://foo.com:b@d/",
  651. "origin": "http://d",
  652. "protocol": "http:",
  653. "username": "foo.com",
  654. "password": "b",
  655. "host": "d",
  656. "hostname": "d",
  657. "port": "",
  658. "pathname": "/",
  659. "search": "",
  660. "hash": ""
  661. },
  662. {
  663. "input": "http://foo.com/\\@",
  664. "base": "http://example.org/foo/bar",
  665. "href": "http://foo.com//@",
  666. "origin": "http://foo.com",
  667. "protocol": "http:",
  668. "username": "",
  669. "password": "",
  670. "host": "foo.com",
  671. "hostname": "foo.com",
  672. "port": "",
  673. "pathname": "//@",
  674. "search": "",
  675. "hash": ""
  676. },
  677. {
  678. "input": "http:\\\\foo.com\\",
  679. "base": "http://example.org/foo/bar",
  680. "href": "http://foo.com/",
  681. "origin": "http://foo.com",
  682. "protocol": "http:",
  683. "username": "",
  684. "password": "",
  685. "host": "foo.com",
  686. "hostname": "foo.com",
  687. "port": "",
  688. "pathname": "/",
  689. "search": "",
  690. "hash": ""
  691. },
  692. {
  693. "input": "http:\\\\a\\b:c\\d@foo.com\\",
  694. "base": "http://example.org/foo/bar",
  695. "href": "http://a/b:c/d@foo.com/",
  696. "origin": "http://a",
  697. "protocol": "http:",
  698. "username": "",
  699. "password": "",
  700. "host": "a",
  701. "hostname": "a",
  702. "port": "",
  703. "pathname": "/b:c/d@foo.com/",
  704. "search": "",
  705. "hash": ""
  706. },
  707. {
  708. "input": "foo:/",
  709. "base": "http://example.org/foo/bar",
  710. "href": "foo:/",
  711. "origin": "null",
  712. "protocol": "foo:",
  713. "username": "",
  714. "password": "",
  715. "host": "",
  716. "hostname": "",
  717. "port": "",
  718. "pathname": "/",
  719. "search": "",
  720. "hash": ""
  721. },
  722. {
  723. "input": "foo:/bar.com/",
  724. "base": "http://example.org/foo/bar",
  725. "href": "foo:/bar.com/",
  726. "origin": "null",
  727. "protocol": "foo:",
  728. "username": "",
  729. "password": "",
  730. "host": "",
  731. "hostname": "",
  732. "port": "",
  733. "pathname": "/bar.com/",
  734. "search": "",
  735. "hash": ""
  736. },
  737. {
  738. "input": "foo://///////",
  739. "base": "http://example.org/foo/bar",
  740. "href": "foo://///////",
  741. "origin": "null",
  742. "protocol": "foo:",
  743. "username": "",
  744. "password": "",
  745. "host": "",
  746. "hostname": "",
  747. "port": "",
  748. "pathname": "///////",
  749. "search": "",
  750. "hash": ""
  751. },
  752. {
  753. "input": "foo://///////bar.com/",
  754. "base": "http://example.org/foo/bar",
  755. "href": "foo://///////bar.com/",
  756. "origin": "null",
  757. "protocol": "foo:",
  758. "username": "",
  759. "password": "",
  760. "host": "",
  761. "hostname": "",
  762. "port": "",
  763. "pathname": "///////bar.com/",
  764. "search": "",
  765. "hash": ""
  766. },
  767. {
  768. "input": "foo:////://///",
  769. "base": "http://example.org/foo/bar",
  770. "href": "foo:////://///",
  771. "origin": "null",
  772. "protocol": "foo:",
  773. "username": "",
  774. "password": "",
  775. "host": "",
  776. "hostname": "",
  777. "port": "",
  778. "pathname": "//://///",
  779. "search": "",
  780. "hash": ""
  781. },
  782. {
  783. "input": "c:/foo",
  784. "base": "http://example.org/foo/bar",
  785. "href": "c:/foo",
  786. "origin": "null",
  787. "protocol": "c:",
  788. "username": "",
  789. "password": "",
  790. "host": "",
  791. "hostname": "",
  792. "port": "",
  793. "pathname": "/foo",
  794. "search": "",
  795. "hash": ""
  796. },
  797. {
  798. "input": "//foo/bar",
  799. "base": "http://example.org/foo/bar",
  800. "href": "http://foo/bar",
  801. "origin": "http://foo",
  802. "protocol": "http:",
  803. "username": "",
  804. "password": "",
  805. "host": "foo",
  806. "hostname": "foo",
  807. "port": "",
  808. "pathname": "/bar",
  809. "search": "",
  810. "hash": ""
  811. },
  812. {
  813. "input": "http://foo/path;a??e#f#g",
  814. "base": "http://example.org/foo/bar",
  815. "href": "http://foo/path;a??e#f#g",
  816. "origin": "http://foo",
  817. "protocol": "http:",
  818. "username": "",
  819. "password": "",
  820. "host": "foo",
  821. "hostname": "foo",
  822. "port": "",
  823. "pathname": "/path;a",
  824. "search": "??e",
  825. "hash": "#f#g"
  826. },
  827. {
  828. "input": "http://foo/abcd?efgh?ijkl",
  829. "base": "http://example.org/foo/bar",
  830. "href": "http://foo/abcd?efgh?ijkl",
  831. "origin": "http://foo",
  832. "protocol": "http:",
  833. "username": "",
  834. "password": "",
  835. "host": "foo",
  836. "hostname": "foo",
  837. "port": "",
  838. "pathname": "/abcd",
  839. "search": "?efgh?ijkl",
  840. "hash": ""
  841. },
  842. {
  843. "input": "http://foo/abcd#foo?bar",
  844. "base": "http://example.org/foo/bar",
  845. "href": "http://foo/abcd#foo?bar",
  846. "origin": "http://foo",
  847. "protocol": "http:",
  848. "username": "",
  849. "password": "",
  850. "host": "foo",
  851. "hostname": "foo",
  852. "port": "",
  853. "pathname": "/abcd",
  854. "search": "",
  855. "hash": "#foo?bar"
  856. },
  857. {
  858. "input": "[61:24:74]:98",
  859. "base": "http://example.org/foo/bar",
  860. "href": "http://example.org/foo/[61:24:74]:98",
  861. "origin": "http://example.org",
  862. "protocol": "http:",
  863. "username": "",
  864. "password": "",
  865. "host": "example.org",
  866. "hostname": "example.org",
  867. "port": "",
  868. "pathname": "/foo/[61:24:74]:98",
  869. "search": "",
  870. "hash": ""
  871. },
  872. {
  873. "input": "http:[61:27]/:foo",
  874. "base": "http://example.org/foo/bar",
  875. "href": "http://example.org/foo/[61:27]/:foo",
  876. "origin": "http://example.org",
  877. "protocol": "http:",
  878. "username": "",
  879. "password": "",
  880. "host": "example.org",
  881. "hostname": "example.org",
  882. "port": "",
  883. "pathname": "/foo/[61:27]/:foo",
  884. "search": "",
  885. "hash": ""
  886. },
  887. {
  888. "input": "http://[1::2]:3:4",
  889. "base": "http://example.org/foo/bar",
  890. "failure": true
  891. },
  892. {
  893. "input": "http://2001::1",
  894. "base": "http://example.org/foo/bar",
  895. "failure": true
  896. },
  897. {
  898. "input": "http://2001::1]",
  899. "base": "http://example.org/foo/bar",
  900. "failure": true
  901. },
  902. {
  903. "input": "http://2001::1]:80",
  904. "base": "http://example.org/foo/bar",
  905. "failure": true
  906. },
  907. {
  908. "input": "http://[2001::1]",
  909. "base": "http://example.org/foo/bar",
  910. "href": "http://[2001::1]/",
  911. "origin": "http://[2001::1]",
  912. "protocol": "http:",
  913. "username": "",
  914. "password": "",
  915. "host": "[2001::1]",
  916. "hostname": "[2001::1]",
  917. "port": "",
  918. "pathname": "/",
  919. "search": "",
  920. "hash": ""
  921. },
  922. {
  923. "input": "http://[::127.0.0.1]",
  924. "base": "http://example.org/foo/bar",
  925. "href": "http://[::7f00:1]/",
  926. "origin": "http://[::7f00:1]",
  927. "protocol": "http:",
  928. "username": "",
  929. "password": "",
  930. "host": "[::7f00:1]",
  931. "hostname": "[::7f00:1]",
  932. "port": "",
  933. "pathname": "/",
  934. "search": "",
  935. "hash": ""
  936. },
  937. {
  938. "input": "http://[0:0:0:0:0:0:13.1.68.3]",
  939. "base": "http://example.org/foo/bar",
  940. "href": "http://[::d01:4403]/",
  941. "origin": "http://[::d01:4403]",
  942. "protocol": "http:",
  943. "username": "",
  944. "password": "",
  945. "host": "[::d01:4403]",
  946. "hostname": "[::d01:4403]",
  947. "port": "",
  948. "pathname": "/",
  949. "search": "",
  950. "hash": ""
  951. },
  952. {
  953. "input": "http://[2001::1]:80",
  954. "base": "http://example.org/foo/bar",
  955. "href": "http://[2001::1]/",
  956. "origin": "http://[2001::1]",
  957. "protocol": "http:",
  958. "username": "",
  959. "password": "",
  960. "host": "[2001::1]",
  961. "hostname": "[2001::1]",
  962. "port": "",
  963. "pathname": "/",
  964. "search": "",
  965. "hash": ""
  966. },
  967. {
  968. "input": "http:/example.com/",
  969. "base": "http://example.org/foo/bar",
  970. "href": "http://example.org/example.com/",
  971. "origin": "http://example.org",
  972. "protocol": "http:",
  973. "username": "",
  974. "password": "",
  975. "host": "example.org",
  976. "hostname": "example.org",
  977. "port": "",
  978. "pathname": "/example.com/",
  979. "search": "",
  980. "hash": ""
  981. },
  982. {
  983. "input": "ftp:/example.com/",
  984. "base": "http://example.org/foo/bar",
  985. "href": "ftp://example.com/",
  986. "origin": "ftp://example.com",
  987. "protocol": "ftp:",
  988. "username": "",
  989. "password": "",
  990. "host": "example.com",
  991. "hostname": "example.com",
  992. "port": "",
  993. "pathname": "/",
  994. "search": "",
  995. "hash": ""
  996. },
  997. {
  998. "input": "https:/example.com/",
  999. "base": "http://example.org/foo/bar",
  1000. "href": "https://example.com/",
  1001. "origin": "https://example.com",
  1002. "protocol": "https:",
  1003. "username": "",
  1004. "password": "",
  1005. "host": "example.com",
  1006. "hostname": "example.com",
  1007. "port": "",
  1008. "pathname": "/",
  1009. "search": "",
  1010. "hash": ""
  1011. },
  1012. {
  1013. "input": "madeupscheme:/example.com/",
  1014. "base": "http://example.org/foo/bar",
  1015. "href": "madeupscheme:/example.com/",
  1016. "origin": "null",
  1017. "protocol": "madeupscheme:",
  1018. "username": "",
  1019. "password": "",
  1020. "host": "",
  1021. "hostname": "",
  1022. "port": "",
  1023. "pathname": "/example.com/",
  1024. "search": "",
  1025. "hash": ""
  1026. },
  1027. {
  1028. "input": "file:/example.com/",
  1029. "base": "http://example.org/foo/bar",
  1030. "href": "file:///example.com/",
  1031. "protocol": "file:",
  1032. "username": "",
  1033. "password": "",
  1034. "host": "",
  1035. "hostname": "",
  1036. "port": "",
  1037. "pathname": "/example.com/",
  1038. "search": "",
  1039. "hash": ""
  1040. },
  1041. {
  1042. "input": "file://example:1/",
  1043. "base": "about:blank",
  1044. "failure": true
  1045. },
  1046. {
  1047. "input": "file://example:test/",
  1048. "base": "about:blank",
  1049. "failure": true
  1050. },
  1051. {
  1052. "input": "file://example%/",
  1053. "base": "about:blank",
  1054. "failure": true
  1055. },
  1056. {
  1057. "input": "file://[example]/",
  1058. "base": "about:blank",
  1059. "failure": true
  1060. },
  1061. {
  1062. "input": "ftps:/example.com/",
  1063. "base": "http://example.org/foo/bar",
  1064. "href": "ftps:/example.com/",
  1065. "origin": "null",
  1066. "protocol": "ftps:",
  1067. "username": "",
  1068. "password": "",
  1069. "host": "",
  1070. "hostname": "",
  1071. "port": "",
  1072. "pathname": "/example.com/",
  1073. "search": "",
  1074. "hash": ""
  1075. },
  1076. {
  1077. "input": "gopher:/example.com/",
  1078. "base": "http://example.org/foo/bar",
  1079. "href": "gopher://example.com/",
  1080. "origin": "gopher://example.com",
  1081. "protocol": "gopher:",
  1082. "username": "",
  1083. "password": "",
  1084. "host": "example.com",
  1085. "hostname": "example.com",
  1086. "port": "",
  1087. "pathname": "/",
  1088. "search": "",
  1089. "hash": ""
  1090. },
  1091. {
  1092. "input": "ws:/example.com/",
  1093. "base": "http://example.org/foo/bar",
  1094. "href": "ws://example.com/",
  1095. "origin": "ws://example.com",
  1096. "protocol": "ws:",
  1097. "username": "",
  1098. "password": "",
  1099. "host": "example.com",
  1100. "hostname": "example.com",
  1101. "port": "",
  1102. "pathname": "/",
  1103. "search": "",
  1104. "hash": ""
  1105. },
  1106. {
  1107. "input": "wss:/example.com/",
  1108. "base": "http://example.org/foo/bar",
  1109. "href": "wss://example.com/",
  1110. "origin": "wss://example.com",
  1111. "protocol": "wss:",
  1112. "username": "",
  1113. "password": "",
  1114. "host": "example.com",
  1115. "hostname": "example.com",
  1116. "port": "",
  1117. "pathname": "/",
  1118. "search": "",
  1119. "hash": ""
  1120. },
  1121. {
  1122. "input": "data:/example.com/",
  1123. "base": "http://example.org/foo/bar",
  1124. "href": "data:/example.com/",
  1125. "origin": "null",
  1126. "protocol": "data:",
  1127. "username": "",
  1128. "password": "",
  1129. "host": "",
  1130. "hostname": "",
  1131. "port": "",
  1132. "pathname": "/example.com/",
  1133. "search": "",
  1134. "hash": ""
  1135. },
  1136. {
  1137. "input": "javascript:/example.com/",
  1138. "base": "http://example.org/foo/bar",
  1139. "href": "javascript:/example.com/",
  1140. "origin": "null",
  1141. "protocol": "javascript:",
  1142. "username": "",
  1143. "password": "",
  1144. "host": "",
  1145. "hostname": "",
  1146. "port": "",
  1147. "pathname": "/example.com/",
  1148. "search": "",
  1149. "hash": ""
  1150. },
  1151. {
  1152. "input": "mailto:/example.com/",
  1153. "base": "http://example.org/foo/bar",
  1154. "href": "mailto:/example.com/",
  1155. "origin": "null",
  1156. "protocol": "mailto:",
  1157. "username": "",
  1158. "password": "",
  1159. "host": "",
  1160. "hostname": "",
  1161. "port": "",
  1162. "pathname": "/example.com/",
  1163. "search": "",
  1164. "hash": ""
  1165. },
  1166. {
  1167. "input": "http:example.com/",
  1168. "base": "http://example.org/foo/bar",
  1169. "href": "http://example.org/foo/example.com/",
  1170. "origin": "http://example.org",
  1171. "protocol": "http:",
  1172. "username": "",
  1173. "password": "",
  1174. "host": "example.org",
  1175. "hostname": "example.org",
  1176. "port": "",
  1177. "pathname": "/foo/example.com/",
  1178. "search": "",
  1179. "hash": ""
  1180. },
  1181. {
  1182. "input": "ftp:example.com/",
  1183. "base": "http://example.org/foo/bar",
  1184. "href": "ftp://example.com/",
  1185. "origin": "ftp://example.com",
  1186. "protocol": "ftp:",
  1187. "username": "",
  1188. "password": "",
  1189. "host": "example.com",
  1190. "hostname": "example.com",
  1191. "port": "",
  1192. "pathname": "/",
  1193. "search": "",
  1194. "hash": ""
  1195. },
  1196. {
  1197. "input": "https:example.com/",
  1198. "base": "http://example.org/foo/bar",
  1199. "href": "https://example.com/",
  1200. "origin": "https://example.com",
  1201. "protocol": "https:",
  1202. "username": "",
  1203. "password": "",
  1204. "host": "example.com",
  1205. "hostname": "example.com",
  1206. "port": "",
  1207. "pathname": "/",
  1208. "search": "",
  1209. "hash": ""
  1210. },
  1211. {
  1212. "input": "madeupscheme:example.com/",
  1213. "base": "http://example.org/foo/bar",
  1214. "href": "madeupscheme:example.com/",
  1215. "origin": "null",
  1216. "protocol": "madeupscheme:",
  1217. "username": "",
  1218. "password": "",
  1219. "host": "",
  1220. "hostname": "",
  1221. "port": "",
  1222. "pathname": "example.com/",
  1223. "search": "",
  1224. "hash": ""
  1225. },
  1226. {
  1227. "input": "ftps:example.com/",
  1228. "base": "http://example.org/foo/bar",
  1229. "href": "ftps:example.com/",
  1230. "origin": "null",
  1231. "protocol": "ftps:",
  1232. "username": "",
  1233. "password": "",
  1234. "host": "",
  1235. "hostname": "",
  1236. "port": "",
  1237. "pathname": "example.com/",
  1238. "search": "",
  1239. "hash": ""
  1240. },
  1241. {
  1242. "input": "gopher:example.com/",
  1243. "base": "http://example.org/foo/bar",
  1244. "href": "gopher://example.com/",
  1245. "origin": "gopher://example.com",
  1246. "protocol": "gopher:",
  1247. "username": "",
  1248. "password": "",
  1249. "host": "example.com",
  1250. "hostname": "example.com",
  1251. "port": "",
  1252. "pathname": "/",
  1253. "search": "",
  1254. "hash": ""
  1255. },
  1256. {
  1257. "input": "ws:example.com/",
  1258. "base": "http://example.org/foo/bar",
  1259. "href": "ws://example.com/",
  1260. "origin": "ws://example.com",
  1261. "protocol": "ws:",
  1262. "username": "",
  1263. "password": "",
  1264. "host": "example.com",
  1265. "hostname": "example.com",
  1266. "port": "",
  1267. "pathname": "/",
  1268. "search": "",
  1269. "hash": ""
  1270. },
  1271. {
  1272. "input": "wss:example.com/",
  1273. "base": "http://example.org/foo/bar",
  1274. "href": "wss://example.com/",
  1275. "origin": "wss://example.com",
  1276. "protocol": "wss:",
  1277. "username": "",
  1278. "password": "",
  1279. "host": "example.com",
  1280. "hostname": "example.com",
  1281. "port": "",
  1282. "pathname": "/",
  1283. "search": "",
  1284. "hash": ""
  1285. },
  1286. {
  1287. "input": "data:example.com/",
  1288. "base": "http://example.org/foo/bar",
  1289. "href": "data:example.com/",
  1290. "origin": "null",
  1291. "protocol": "data:",
  1292. "username": "",
  1293. "password": "",
  1294. "host": "",
  1295. "hostname": "",
  1296. "port": "",
  1297. "pathname": "example.com/",
  1298. "search": "",
  1299. "hash": ""
  1300. },
  1301. {
  1302. "input": "javascript:example.com/",
  1303. "base": "http://example.org/foo/bar",
  1304. "href": "javascript:example.com/",
  1305. "origin": "null",
  1306. "protocol": "javascript:",
  1307. "username": "",
  1308. "password": "",
  1309. "host": "",
  1310. "hostname": "",
  1311. "port": "",
  1312. "pathname": "example.com/",
  1313. "search": "",
  1314. "hash": ""
  1315. },
  1316. {
  1317. "input": "mailto:example.com/",
  1318. "base": "http://example.org/foo/bar",
  1319. "href": "mailto:example.com/",
  1320. "origin": "null",
  1321. "protocol": "mailto:",
  1322. "username": "",
  1323. "password": "",
  1324. "host": "",
  1325. "hostname": "",
  1326. "port": "",
  1327. "pathname": "example.com/",
  1328. "search": "",
  1329. "hash": ""
  1330. },
  1331. {
  1332. "input": "/a/b/c",
  1333. "base": "http://example.org/foo/bar",
  1334. "href": "http://example.org/a/b/c",
  1335. "origin": "http://example.org",
  1336. "protocol": "http:",
  1337. "username": "",
  1338. "password": "",
  1339. "host": "example.org",
  1340. "hostname": "example.org",
  1341. "port": "",
  1342. "pathname": "/a/b/c",
  1343. "search": "",
  1344. "hash": ""
  1345. },
  1346. {
  1347. "input": "/a/ /c",
  1348. "base": "http://example.org/foo/bar",
  1349. "href": "http://example.org/a/%20/c",
  1350. "origin": "http://example.org",
  1351. "protocol": "http:",
  1352. "username": "",
  1353. "password": "",
  1354. "host": "example.org",
  1355. "hostname": "example.org",
  1356. "port": "",
  1357. "pathname": "/a/%20/c",
  1358. "search": "",
  1359. "hash": ""
  1360. },
  1361. {
  1362. "input": "/a%2fc",
  1363. "base": "http://example.org/foo/bar",
  1364. "href": "http://example.org/a%2fc",
  1365. "origin": "http://example.org",
  1366. "protocol": "http:",
  1367. "username": "",
  1368. "password": "",
  1369. "host": "example.org",
  1370. "hostname": "example.org",
  1371. "port": "",
  1372. "pathname": "/a%2fc",
  1373. "search": "",
  1374. "hash": ""
  1375. },
  1376. {
  1377. "input": "/a/%2f/c",
  1378. "base": "http://example.org/foo/bar",
  1379. "href": "http://example.org/a/%2f/c",
  1380. "origin": "http://example.org",
  1381. "protocol": "http:",
  1382. "username": "",
  1383. "password": "",
  1384. "host": "example.org",
  1385. "hostname": "example.org",
  1386. "port": "",
  1387. "pathname": "/a/%2f/c",
  1388. "search": "",
  1389. "hash": ""
  1390. },
  1391. {
  1392. "input": "#β",
  1393. "base": "http://example.org/foo/bar",
  1394. "href": "http://example.org/foo/bar#%CE%B2",
  1395. "origin": "http://example.org",
  1396. "protocol": "http:",
  1397. "username": "",
  1398. "password": "",
  1399. "host": "example.org",
  1400. "hostname": "example.org",
  1401. "port": "",
  1402. "pathname": "/foo/bar",
  1403. "search": "",
  1404. "hash": "#%CE%B2"
  1405. },
  1406. {
  1407. "input": "data:text/html,test#test",
  1408. "base": "http://example.org/foo/bar",
  1409. "href": "data:text/html,test#test",
  1410. "origin": "null",
  1411. "protocol": "data:",
  1412. "username": "",
  1413. "password": "",
  1414. "host": "",
  1415. "hostname": "",
  1416. "port": "",
  1417. "pathname": "text/html,test",
  1418. "search": "",
  1419. "hash": "#test"
  1420. },
  1421. {
  1422. "input": "tel:1234567890",
  1423. "base": "http://example.org/foo/bar",
  1424. "href": "tel:1234567890",
  1425. "origin": "null",
  1426. "protocol": "tel:",
  1427. "username": "",
  1428. "password": "",
  1429. "host": "",
  1430. "hostname": "",
  1431. "port": "",
  1432. "pathname": "1234567890",
  1433. "search": "",
  1434. "hash": ""
  1435. },
  1436. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
  1437. {
  1438. "input": "file:c:\\foo\\bar.html",
  1439. "base": "file:///tmp/mock/path",
  1440. "href": "file:///c:/foo/bar.html",
  1441. "protocol": "file:",
  1442. "username": "",
  1443. "password": "",
  1444. "host": "",
  1445. "hostname": "",
  1446. "port": "",
  1447. "pathname": "/c:/foo/bar.html",
  1448. "search": "",
  1449. "hash": ""
  1450. },
  1451. {
  1452. "input": " File:c|////foo\\bar.html",
  1453. "base": "file:///tmp/mock/path",
  1454. "href": "file:///c:////foo/bar.html",
  1455. "protocol": "file:",
  1456. "username": "",
  1457. "password": "",
  1458. "host": "",
  1459. "hostname": "",
  1460. "port": "",
  1461. "pathname": "/c:////foo/bar.html",
  1462. "search": "",
  1463. "hash": ""
  1464. },
  1465. {
  1466. "input": "C|/foo/bar",
  1467. "base": "file:///tmp/mock/path",
  1468. "href": "file:///C:/foo/bar",
  1469. "protocol": "file:",
  1470. "username": "",
  1471. "password": "",
  1472. "host": "",
  1473. "hostname": "",
  1474. "port": "",
  1475. "pathname": "/C:/foo/bar",
  1476. "search": "",
  1477. "hash": ""
  1478. },
  1479. {
  1480. "input": "/C|\\foo\\bar",
  1481. "base": "file:///tmp/mock/path",
  1482. "href": "file:///C:/foo/bar",
  1483. "protocol": "file:",
  1484. "username": "",
  1485. "password": "",
  1486. "host": "",
  1487. "hostname": "",
  1488. "port": "",
  1489. "pathname": "/C:/foo/bar",
  1490. "search": "",
  1491. "hash": ""
  1492. },
  1493. {
  1494. "input": "//C|/foo/bar",
  1495. "base": "file:///tmp/mock/path",
  1496. "href": "file:///C:/foo/bar",
  1497. "protocol": "file:",
  1498. "username": "",
  1499. "password": "",
  1500. "host": "",
  1501. "hostname": "",
  1502. "port": "",
  1503. "pathname": "/C:/foo/bar",
  1504. "search": "",
  1505. "hash": ""
  1506. },
  1507. {
  1508. "input": "//server/file",
  1509. "base": "file:///tmp/mock/path",
  1510. "href": "file://server/file",
  1511. "protocol": "file:",
  1512. "username": "",
  1513. "password": "",
  1514. "host": "server",
  1515. "hostname": "server",
  1516. "port": "",
  1517. "pathname": "/file",
  1518. "search": "",
  1519. "hash": ""
  1520. },
  1521. {
  1522. "input": "\\\\server\\file",
  1523. "base": "file:///tmp/mock/path",
  1524. "href": "file://server/file",
  1525. "protocol": "file:",
  1526. "username": "",
  1527. "password": "",
  1528. "host": "server",
  1529. "hostname": "server",
  1530. "port": "",
  1531. "pathname": "/file",
  1532. "search": "",
  1533. "hash": ""
  1534. },
  1535. {
  1536. "input": "/\\server/file",
  1537. "base": "file:///tmp/mock/path",
  1538. "href": "file://server/file",
  1539. "protocol": "file:",
  1540. "username": "",
  1541. "password": "",
  1542. "host": "server",
  1543. "hostname": "server",
  1544. "port": "",
  1545. "pathname": "/file",
  1546. "search": "",
  1547. "hash": ""
  1548. },
  1549. {
  1550. "input": "file:///foo/bar.txt",
  1551. "base": "file:///tmp/mock/path",
  1552. "href": "file:///foo/bar.txt",
  1553. "protocol": "file:",
  1554. "username": "",
  1555. "password": "",
  1556. "host": "",
  1557. "hostname": "",
  1558. "port": "",
  1559. "pathname": "/foo/bar.txt",
  1560. "search": "",
  1561. "hash": ""
  1562. },
  1563. {
  1564. "input": "file:///home/me",
  1565. "base": "file:///tmp/mock/path",
  1566. "href": "file:///home/me",
  1567. "protocol": "file:",
  1568. "username": "",
  1569. "password": "",
  1570. "host": "",
  1571. "hostname": "",
  1572. "port": "",
  1573. "pathname": "/home/me",
  1574. "search": "",
  1575. "hash": ""
  1576. },
  1577. {
  1578. "input": "//",
  1579. "base": "file:///tmp/mock/path",
  1580. "href": "file:///",
  1581. "protocol": "file:",
  1582. "username": "",
  1583. "password": "",
  1584. "host": "",
  1585. "hostname": "",
  1586. "port": "",
  1587. "pathname": "/",
  1588. "search": "",
  1589. "hash": ""
  1590. },
  1591. {
  1592. "input": "///",
  1593. "base": "file:///tmp/mock/path",
  1594. "href": "file:///",
  1595. "protocol": "file:",
  1596. "username": "",
  1597. "password": "",
  1598. "host": "",
  1599. "hostname": "",
  1600. "port": "",
  1601. "pathname": "/",
  1602. "search": "",
  1603. "hash": ""
  1604. },
  1605. {
  1606. "input": "///test",
  1607. "base": "file:///tmp/mock/path",
  1608. "href": "file:///test",
  1609. "protocol": "file:",
  1610. "username": "",
  1611. "password": "",
  1612. "host": "",
  1613. "hostname": "",
  1614. "port": "",
  1615. "pathname": "/test",
  1616. "search": "",
  1617. "hash": ""
  1618. },
  1619. {
  1620. "input": "file://test",
  1621. "base": "file:///tmp/mock/path",
  1622. "href": "file://test/",
  1623. "protocol": "file:",
  1624. "username": "",
  1625. "password": "",
  1626. "host": "test",
  1627. "hostname": "test",
  1628. "port": "",
  1629. "pathname": "/",
  1630. "search": "",
  1631. "hash": ""
  1632. },
  1633. {
  1634. "input": "file://localhost",
  1635. "base": "file:///tmp/mock/path",
  1636. "href": "file:///",
  1637. "protocol": "file:",
  1638. "username": "",
  1639. "password": "",
  1640. "host": "",
  1641. "hostname": "",
  1642. "port": "",
  1643. "pathname": "/",
  1644. "search": "",
  1645. "hash": ""
  1646. },
  1647. {
  1648. "input": "file://localhost/",
  1649. "base": "file:///tmp/mock/path",
  1650. "href": "file:///",
  1651. "protocol": "file:",
  1652. "username": "",
  1653. "password": "",
  1654. "host": "",
  1655. "hostname": "",
  1656. "port": "",
  1657. "pathname": "/",
  1658. "search": "",
  1659. "hash": ""
  1660. },
  1661. {
  1662. "input": "file://localhost/test",
  1663. "base": "file:///tmp/mock/path",
  1664. "href": "file:///test",
  1665. "protocol": "file:",
  1666. "username": "",
  1667. "password": "",
  1668. "host": "",
  1669. "hostname": "",
  1670. "port": "",
  1671. "pathname": "/test",
  1672. "search": "",
  1673. "hash": ""
  1674. },
  1675. {
  1676. "input": "test",
  1677. "base": "file:///tmp/mock/path",
  1678. "href": "file:///tmp/mock/test",
  1679. "protocol": "file:",
  1680. "username": "",
  1681. "password": "",
  1682. "host": "",
  1683. "hostname": "",
  1684. "port": "",
  1685. "pathname": "/tmp/mock/test",
  1686. "search": "",
  1687. "hash": ""
  1688. },
  1689. {
  1690. "input": "file:test",
  1691. "base": "file:///tmp/mock/path",
  1692. "href": "file:///tmp/mock/test",
  1693. "protocol": "file:",
  1694. "username": "",
  1695. "password": "",
  1696. "host": "",
  1697. "hostname": "",
  1698. "port": "",
  1699. "pathname": "/tmp/mock/test",
  1700. "search": "",
  1701. "hash": ""
  1702. },
  1703. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
  1704. {
  1705. "input": "http://example.com/././foo",
  1706. "base": "about:blank",
  1707. "href": "http://example.com/foo",
  1708. "origin": "http://example.com",
  1709. "protocol": "http:",
  1710. "username": "",
  1711. "password": "",
  1712. "host": "example.com",
  1713. "hostname": "example.com",
  1714. "port": "",
  1715. "pathname": "/foo",
  1716. "search": "",
  1717. "hash": ""
  1718. },
  1719. {
  1720. "input": "http://example.com/./.foo",
  1721. "base": "about:blank",
  1722. "href": "http://example.com/.foo",
  1723. "origin": "http://example.com",
  1724. "protocol": "http:",
  1725. "username": "",
  1726. "password": "",
  1727. "host": "example.com",
  1728. "hostname": "example.com",
  1729. "port": "",
  1730. "pathname": "/.foo",
  1731. "search": "",
  1732. "hash": ""
  1733. },
  1734. {
  1735. "input": "http://example.com/foo/.",
  1736. "base": "about:blank",
  1737. "href": "http://example.com/foo/",
  1738. "origin": "http://example.com",
  1739. "protocol": "http:",
  1740. "username": "",
  1741. "password": "",
  1742. "host": "example.com",
  1743. "hostname": "example.com",
  1744. "port": "",
  1745. "pathname": "/foo/",
  1746. "search": "",
  1747. "hash": ""
  1748. },
  1749. {
  1750. "input": "http://example.com/foo/./",
  1751. "base": "about:blank",
  1752. "href": "http://example.com/foo/",
  1753. "origin": "http://example.com",
  1754. "protocol": "http:",
  1755. "username": "",
  1756. "password": "",
  1757. "host": "example.com",
  1758. "hostname": "example.com",
  1759. "port": "",
  1760. "pathname": "/foo/",
  1761. "search": "",
  1762. "hash": ""
  1763. },
  1764. {
  1765. "input": "http://example.com/foo/bar/..",
  1766. "base": "about:blank",
  1767. "href": "http://example.com/foo/",
  1768. "origin": "http://example.com",
  1769. "protocol": "http:",
  1770. "username": "",
  1771. "password": "",
  1772. "host": "example.com",
  1773. "hostname": "example.com",
  1774. "port": "",
  1775. "pathname": "/foo/",
  1776. "search": "",
  1777. "hash": ""
  1778. },
  1779. {
  1780. "input": "http://example.com/foo/bar/../",
  1781. "base": "about:blank",
  1782. "href": "http://example.com/foo/",
  1783. "origin": "http://example.com",
  1784. "protocol": "http:",
  1785. "username": "",
  1786. "password": "",
  1787. "host": "example.com",
  1788. "hostname": "example.com",
  1789. "port": "",
  1790. "pathname": "/foo/",
  1791. "search": "",
  1792. "hash": ""
  1793. },
  1794. {
  1795. "input": "http://example.com/foo/..bar",
  1796. "base": "about:blank",
  1797. "href": "http://example.com/foo/..bar",
  1798. "origin": "http://example.com",
  1799. "protocol": "http:",
  1800. "username": "",
  1801. "password": "",
  1802. "host": "example.com",
  1803. "hostname": "example.com",
  1804. "port": "",
  1805. "pathname": "/foo/..bar",
  1806. "search": "",
  1807. "hash": ""
  1808. },
  1809. {
  1810. "input": "http://example.com/foo/bar/../ton",
  1811. "base": "about:blank",
  1812. "href": "http://example.com/foo/ton",
  1813. "origin": "http://example.com",
  1814. "protocol": "http:",
  1815. "username": "",
  1816. "password": "",
  1817. "host": "example.com",
  1818. "hostname": "example.com",
  1819. "port": "",
  1820. "pathname": "/foo/ton",
  1821. "search": "",
  1822. "hash": ""
  1823. },
  1824. {
  1825. "input": "http://example.com/foo/bar/../ton/../../a",
  1826. "base": "about:blank",
  1827. "href": "http://example.com/a",
  1828. "origin": "http://example.com",
  1829. "protocol": "http:",
  1830. "username": "",
  1831. "password": "",
  1832. "host": "example.com",
  1833. "hostname": "example.com",
  1834. "port": "",
  1835. "pathname": "/a",
  1836. "search": "",
  1837. "hash": ""
  1838. },
  1839. {
  1840. "input": "http://example.com/foo/../../..",
  1841. "base": "about:blank",
  1842. "href": "http://example.com/",
  1843. "origin": "http://example.com",
  1844. "protocol": "http:",
  1845. "username": "",
  1846. "password": "",
  1847. "host": "example.com",
  1848. "hostname": "example.com",
  1849. "port": "",
  1850. "pathname": "/",
  1851. "search": "",
  1852. "hash": ""
  1853. },
  1854. {
  1855. "input": "http://example.com/foo/../../../ton",
  1856. "base": "about:blank",
  1857. "href": "http://example.com/ton",
  1858. "origin": "http://example.com",
  1859. "protocol": "http:",
  1860. "username": "",
  1861. "password": "",
  1862. "host": "example.com",
  1863. "hostname": "example.com",
  1864. "port": "",
  1865. "pathname": "/ton",
  1866. "search": "",
  1867. "hash": ""
  1868. },
  1869. {
  1870. "input": "http://example.com/foo/%2e",
  1871. "base": "about:blank",
  1872. "href": "http://example.com/foo/",
  1873. "origin": "http://example.com",
  1874. "protocol": "http:",
  1875. "username": "",
  1876. "password": "",
  1877. "host": "example.com",
  1878. "hostname": "example.com",
  1879. "port": "",
  1880. "pathname": "/foo/",
  1881. "search": "",
  1882. "hash": ""
  1883. },
  1884. {
  1885. "input": "http://example.com/foo/%2e%2",
  1886. "base": "about:blank",
  1887. "href": "http://example.com/foo/%2e%2",
  1888. "origin": "http://example.com",
  1889. "protocol": "http:",
  1890. "username": "",
  1891. "password": "",
  1892. "host": "example.com",
  1893. "hostname": "example.com",
  1894. "port": "",
  1895. "pathname": "/foo/%2e%2",
  1896. "search": "",
  1897. "hash": ""
  1898. },
  1899. {
  1900. "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
  1901. "base": "about:blank",
  1902. "href": "http://example.com/%2e.bar",
  1903. "origin": "http://example.com",
  1904. "protocol": "http:",
  1905. "username": "",
  1906. "password": "",
  1907. "host": "example.com",
  1908. "hostname": "example.com",
  1909. "port": "",
  1910. "pathname": "/%2e.bar",
  1911. "search": "",
  1912. "hash": ""
  1913. },
  1914. {
  1915. "input": "http://example.com////../..",
  1916. "base": "about:blank",
  1917. "href": "http://example.com//",
  1918. "origin": "http://example.com",
  1919. "protocol": "http:",
  1920. "username": "",
  1921. "password": "",
  1922. "host": "example.com",
  1923. "hostname": "example.com",
  1924. "port": "",
  1925. "pathname": "//",
  1926. "search": "",
  1927. "hash": ""
  1928. },
  1929. {
  1930. "input": "http://example.com/foo/bar//../..",
  1931. "base": "about:blank",
  1932. "href": "http://example.com/foo/",
  1933. "origin": "http://example.com",
  1934. "protocol": "http:",
  1935. "username": "",
  1936. "password": "",
  1937. "host": "example.com",
  1938. "hostname": "example.com",
  1939. "port": "",
  1940. "pathname": "/foo/",
  1941. "search": "",
  1942. "hash": ""
  1943. },
  1944. {
  1945. "input": "http://example.com/foo/bar//..",
  1946. "base": "about:blank",
  1947. "href": "http://example.com/foo/bar/",
  1948. "origin": "http://example.com",
  1949. "protocol": "http:",
  1950. "username": "",
  1951. "password": "",
  1952. "host": "example.com",
  1953. "hostname": "example.com",
  1954. "port": "",
  1955. "pathname": "/foo/bar/",
  1956. "search": "",
  1957. "hash": ""
  1958. },
  1959. {
  1960. "input": "http://example.com/foo",
  1961. "base": "about:blank",
  1962. "href": "http://example.com/foo",
  1963. "origin": "http://example.com",
  1964. "protocol": "http:",
  1965. "username": "",
  1966. "password": "",
  1967. "host": "example.com",
  1968. "hostname": "example.com",
  1969. "port": "",
  1970. "pathname": "/foo",
  1971. "search": "",
  1972. "hash": ""
  1973. },
  1974. {
  1975. "input": "http://example.com/%20foo",
  1976. "base": "about:blank",
  1977. "href": "http://example.com/%20foo",
  1978. "origin": "http://example.com",
  1979. "protocol": "http:",
  1980. "username": "",
  1981. "password": "",
  1982. "host": "example.com",
  1983. "hostname": "example.com",
  1984. "port": "",
  1985. "pathname": "/%20foo",
  1986. "search": "",
  1987. "hash": ""
  1988. },
  1989. {
  1990. "input": "http://example.com/foo%",
  1991. "base": "about:blank",
  1992. "href": "http://example.com/foo%",
  1993. "origin": "http://example.com",
  1994. "protocol": "http:",
  1995. "username": "",
  1996. "password": "",
  1997. "host": "example.com",
  1998. "hostname": "example.com",
  1999. "port": "",
  2000. "pathname": "/foo%",
  2001. "search": "",
  2002. "hash": ""
  2003. },
  2004. {
  2005. "input": "http://example.com/foo%2",
  2006. "base": "about:blank",
  2007. "href": "http://example.com/foo%2",
  2008. "origin": "http://example.com",
  2009. "protocol": "http:",
  2010. "username": "",
  2011. "password": "",
  2012. "host": "example.com",
  2013. "hostname": "example.com",
  2014. "port": "",
  2015. "pathname": "/foo%2",
  2016. "search": "",
  2017. "hash": ""
  2018. },
  2019. {
  2020. "input": "http://example.com/foo%2zbar",
  2021. "base": "about:blank",
  2022. "href": "http://example.com/foo%2zbar",
  2023. "origin": "http://example.com",
  2024. "protocol": "http:",
  2025. "username": "",
  2026. "password": "",
  2027. "host": "example.com",
  2028. "hostname": "example.com",
  2029. "port": "",
  2030. "pathname": "/foo%2zbar",
  2031. "search": "",
  2032. "hash": ""
  2033. },
  2034. {
  2035. "input": "http://example.com/foo%2©zbar",
  2036. "base": "about:blank",
  2037. "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
  2038. "origin": "http://example.com",
  2039. "protocol": "http:",
  2040. "username": "",
  2041. "password": "",
  2042. "host": "example.com",
  2043. "hostname": "example.com",
  2044. "port": "",
  2045. "pathname": "/foo%2%C3%82%C2%A9zbar",
  2046. "search": "",
  2047. "hash": ""
  2048. },
  2049. {
  2050. "input": "http://example.com/foo%41%7a",
  2051. "base": "about:blank",
  2052. "href": "http://example.com/foo%41%7a",
  2053. "origin": "http://example.com",
  2054. "protocol": "http:",
  2055. "username": "",
  2056. "password": "",
  2057. "host": "example.com",
  2058. "hostname": "example.com",
  2059. "port": "",
  2060. "pathname": "/foo%41%7a",
  2061. "search": "",
  2062. "hash": ""
  2063. },
  2064. {
  2065. "input": "http://example.com/foo\t\u0091%91",
  2066. "base": "about:blank",
  2067. "href": "http://example.com/foo%C2%91%91",
  2068. "origin": "http://example.com",
  2069. "protocol": "http:",
  2070. "username": "",
  2071. "password": "",
  2072. "host": "example.com",
  2073. "hostname": "example.com",
  2074. "port": "",
  2075. "pathname": "/foo%C2%91%91",
  2076. "search": "",
  2077. "hash": ""
  2078. },
  2079. {
  2080. "input": "http://example.com/foo%00%51",
  2081. "base": "about:blank",
  2082. "href": "http://example.com/foo%00%51",
  2083. "origin": "http://example.com",
  2084. "protocol": "http:",
  2085. "username": "",
  2086. "password": "",
  2087. "host": "example.com",
  2088. "hostname": "example.com",
  2089. "port": "",
  2090. "pathname": "/foo%00%51",
  2091. "search": "",
  2092. "hash": ""
  2093. },
  2094. {
  2095. "input": "http://example.com/(%28:%3A%29)",
  2096. "base": "about:blank",
  2097. "href": "http://example.com/(%28:%3A%29)",
  2098. "origin": "http://example.com",
  2099. "protocol": "http:",
  2100. "username": "",
  2101. "password": "",
  2102. "host": "example.com",
  2103. "hostname": "example.com",
  2104. "port": "",
  2105. "pathname": "/(%28:%3A%29)",
  2106. "search": "",
  2107. "hash": ""
  2108. },
  2109. {
  2110. "input": "http://example.com/%3A%3a%3C%3c",
  2111. "base": "about:blank",
  2112. "href": "http://example.com/%3A%3a%3C%3c",
  2113. "origin": "http://example.com",
  2114. "protocol": "http:",
  2115. "username": "",
  2116. "password": "",
  2117. "host": "example.com",
  2118. "hostname": "example.com",
  2119. "port": "",
  2120. "pathname": "/%3A%3a%3C%3c",
  2121. "search": "",
  2122. "hash": ""
  2123. },
  2124. {
  2125. "input": "http://example.com/foo\tbar",
  2126. "base": "about:blank",
  2127. "href": "http://example.com/foobar",
  2128. "origin": "http://example.com",
  2129. "protocol": "http:",
  2130. "username": "",
  2131. "password": "",
  2132. "host": "example.com",
  2133. "hostname": "example.com",
  2134. "port": "",
  2135. "pathname": "/foobar",
  2136. "search": "",
  2137. "hash": ""
  2138. },
  2139. {
  2140. "input": "http://example.com\\\\foo\\\\bar",
  2141. "base": "about:blank",
  2142. "href": "http://example.com//foo//bar",
  2143. "origin": "http://example.com",
  2144. "protocol": "http:",
  2145. "username": "",
  2146. "password": "",
  2147. "host": "example.com",
  2148. "hostname": "example.com",
  2149. "port": "",
  2150. "pathname": "//foo//bar",
  2151. "search": "",
  2152. "hash": ""
  2153. },
  2154. {
  2155. "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2156. "base": "about:blank",
  2157. "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2158. "origin": "http://example.com",
  2159. "protocol": "http:",
  2160. "username": "",
  2161. "password": "",
  2162. "host": "example.com",
  2163. "hostname": "example.com",
  2164. "port": "",
  2165. "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
  2166. "search": "",
  2167. "hash": ""
  2168. },
  2169. {
  2170. "input": "http://example.com/@asdf%40",
  2171. "base": "about:blank",
  2172. "href": "http://example.com/@asdf%40",
  2173. "origin": "http://example.com",
  2174. "protocol": "http:",
  2175. "username": "",
  2176. "password": "",
  2177. "host": "example.com",
  2178. "hostname": "example.com",
  2179. "port": "",
  2180. "pathname": "/@asdf%40",
  2181. "search": "",
  2182. "hash": ""
  2183. },
  2184. {
  2185. "input": "http://example.com/你好你好",
  2186. "base": "about:blank",
  2187. "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2188. "origin": "http://example.com",
  2189. "protocol": "http:",
  2190. "username": "",
  2191. "password": "",
  2192. "host": "example.com",
  2193. "hostname": "example.com",
  2194. "port": "",
  2195. "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
  2196. "search": "",
  2197. "hash": ""
  2198. },
  2199. {
  2200. "input": "http://example.com/‥/foo",
  2201. "base": "about:blank",
  2202. "href": "http://example.com/%E2%80%A5/foo",
  2203. "origin": "http://example.com",
  2204. "protocol": "http:",
  2205. "username": "",
  2206. "password": "",
  2207. "host": "example.com",
  2208. "hostname": "example.com",
  2209. "port": "",
  2210. "pathname": "/%E2%80%A5/foo",
  2211. "search": "",
  2212. "hash": ""
  2213. },
  2214. {
  2215. "input": "http://example.com//foo",
  2216. "base": "about:blank",
  2217. "href": "http://example.com/%EF%BB%BF/foo",
  2218. "origin": "http://example.com",
  2219. "protocol": "http:",
  2220. "username": "",
  2221. "password": "",
  2222. "host": "example.com",
  2223. "hostname": "example.com",
  2224. "port": "",
  2225. "pathname": "/%EF%BB%BF/foo",
  2226. "search": "",
  2227. "hash": ""
  2228. },
  2229. {
  2230. "input": "http://example.com/‮/foo/‭/bar",
  2231. "base": "about:blank",
  2232. "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
  2233. "origin": "http://example.com",
  2234. "protocol": "http:",
  2235. "username": "",
  2236. "password": "",
  2237. "host": "example.com",
  2238. "hostname": "example.com",
  2239. "port": "",
  2240. "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
  2241. "search": "",
  2242. "hash": ""
  2243. },
  2244. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
  2245. {
  2246. "input": "http://www.google.com/foo?bar=baz#",
  2247. "base": "about:blank",
  2248. "href": "http://www.google.com/foo?bar=baz#",
  2249. "origin": "http://www.google.com",
  2250. "protocol": "http:",
  2251. "username": "",
  2252. "password": "",
  2253. "host": "www.google.com",
  2254. "hostname": "www.google.com",
  2255. "port": "",
  2256. "pathname": "/foo",
  2257. "search": "?bar=baz",
  2258. "hash": ""
  2259. },
  2260. {
  2261. "input": "http://www.google.com/foo?bar=baz# »",
  2262. "base": "about:blank",
  2263. "href": "http://www.google.com/foo?bar=baz# %C2%BB",
  2264. "origin": "http://www.google.com",
  2265. "protocol": "http:",
  2266. "username": "",
  2267. "password": "",
  2268. "host": "www.google.com",
  2269. "hostname": "www.google.com",
  2270. "port": "",
  2271. "pathname": "/foo",
  2272. "search": "?bar=baz",
  2273. "hash": "# %C2%BB"
  2274. },
  2275. {
  2276. "input": "data:test# »",
  2277. "base": "about:blank",
  2278. "href": "data:test# %C2%BB",
  2279. "origin": "null",
  2280. "protocol": "data:",
  2281. "username": "",
  2282. "password": "",
  2283. "host": "",
  2284. "hostname": "",
  2285. "port": "",
  2286. "pathname": "test",
  2287. "search": "",
  2288. "hash": "# %C2%BB"
  2289. },
  2290. {
  2291. "input": "http://www.google.com",
  2292. "base": "about:blank",
  2293. "href": "http://www.google.com/",
  2294. "origin": "http://www.google.com",
  2295. "protocol": "http:",
  2296. "username": "",
  2297. "password": "",
  2298. "host": "www.google.com",
  2299. "hostname": "www.google.com",
  2300. "port": "",
  2301. "pathname": "/",
  2302. "search": "",
  2303. "hash": ""
  2304. },
  2305. {
  2306. "input": "http://192.0x00A80001",
  2307. "base": "about:blank",
  2308. "href": "http://192.168.0.1/",
  2309. "origin": "http://192.168.0.1",
  2310. "protocol": "http:",
  2311. "username": "",
  2312. "password": "",
  2313. "host": "192.168.0.1",
  2314. "hostname": "192.168.0.1",
  2315. "port": "",
  2316. "pathname": "/",
  2317. "search": "",
  2318. "hash": ""
  2319. },
  2320. {
  2321. "input": "http://www/foo%2Ehtml",
  2322. "base": "about:blank",
  2323. "href": "http://www/foo%2Ehtml",
  2324. "origin": "http://www",
  2325. "protocol": "http:",
  2326. "username": "",
  2327. "password": "",
  2328. "host": "www",
  2329. "hostname": "www",
  2330. "port": "",
  2331. "pathname": "/foo%2Ehtml",
  2332. "search": "",
  2333. "hash": ""
  2334. },
  2335. {
  2336. "input": "http://www/foo/%2E/html",
  2337. "base": "about:blank",
  2338. "href": "http://www/foo/html",
  2339. "origin": "http://www",
  2340. "protocol": "http:",
  2341. "username": "",
  2342. "password": "",
  2343. "host": "www",
  2344. "hostname": "www",
  2345. "port": "",
  2346. "pathname": "/foo/html",
  2347. "search": "",
  2348. "hash": ""
  2349. },
  2350. {
  2351. "input": "http://user:pass@/",
  2352. "base": "about:blank",
  2353. "failure": true
  2354. },
  2355. {
  2356. "input": "http://%25DOMAIN:foobar@foodomain.com/",
  2357. "base": "about:blank",
  2358. "href": "http://%25DOMAIN:foobar@foodomain.com/",
  2359. "origin": "http://foodomain.com",
  2360. "protocol": "http:",
  2361. "username": "%25DOMAIN",
  2362. "password": "foobar",
  2363. "host": "foodomain.com",
  2364. "hostname": "foodomain.com",
  2365. "port": "",
  2366. "pathname": "/",
  2367. "search": "",
  2368. "hash": ""
  2369. },
  2370. {
  2371. "input": "http:\\\\www.google.com\\foo",
  2372. "base": "about:blank",
  2373. "href": "http://www.google.com/foo",
  2374. "origin": "http://www.google.com",
  2375. "protocol": "http:",
  2376. "username": "",
  2377. "password": "",
  2378. "host": "www.google.com",
  2379. "hostname": "www.google.com",
  2380. "port": "",
  2381. "pathname": "/foo",
  2382. "search": "",
  2383. "hash": ""
  2384. },
  2385. {
  2386. "input": "http://foo:80/",
  2387. "base": "about:blank",
  2388. "href": "http://foo/",
  2389. "origin": "http://foo",
  2390. "protocol": "http:",
  2391. "username": "",
  2392. "password": "",
  2393. "host": "foo",
  2394. "hostname": "foo",
  2395. "port": "",
  2396. "pathname": "/",
  2397. "search": "",
  2398. "hash": ""
  2399. },
  2400. {
  2401. "input": "http://foo:81/",
  2402. "base": "about:blank",
  2403. "href": "http://foo:81/",
  2404. "origin": "http://foo:81",
  2405. "protocol": "http:",
  2406. "username": "",
  2407. "password": "",
  2408. "host": "foo:81",
  2409. "hostname": "foo",
  2410. "port": "81",
  2411. "pathname": "/",
  2412. "search": "",
  2413. "hash": ""
  2414. },
  2415. {
  2416. "input": "httpa://foo:80/",
  2417. "base": "about:blank",
  2418. "href": "httpa://foo:80/",
  2419. "origin": "null",
  2420. "protocol": "httpa:",
  2421. "username": "",
  2422. "password": "",
  2423. "host": "foo:80",
  2424. "hostname": "foo",
  2425. "port": "80",
  2426. "pathname": "/",
  2427. "search": "",
  2428. "hash": ""
  2429. },
  2430. {
  2431. "input": "http://foo:-80/",
  2432. "base": "about:blank",
  2433. "failure": true
  2434. },
  2435. {
  2436. "input": "https://foo:443/",
  2437. "base": "about:blank",
  2438. "href": "https://foo/",
  2439. "origin": "https://foo",
  2440. "protocol": "https:",
  2441. "username": "",
  2442. "password": "",
  2443. "host": "foo",
  2444. "hostname": "foo",
  2445. "port": "",
  2446. "pathname": "/",
  2447. "search": "",
  2448. "hash": ""
  2449. },
  2450. {
  2451. "input": "https://foo:80/",
  2452. "base": "about:blank",
  2453. "href": "https://foo:80/",
  2454. "origin": "https://foo:80",
  2455. "protocol": "https:",
  2456. "username": "",
  2457. "password": "",
  2458. "host": "foo:80",
  2459. "hostname": "foo",
  2460. "port": "80",
  2461. "pathname": "/",
  2462. "search": "",
  2463. "hash": ""
  2464. },
  2465. {
  2466. "input": "ftp://foo:21/",
  2467. "base": "about:blank",
  2468. "href": "ftp://foo/",
  2469. "origin": "ftp://foo",
  2470. "protocol": "ftp:",
  2471. "username": "",
  2472. "password": "",
  2473. "host": "foo",
  2474. "hostname": "foo",
  2475. "port": "",
  2476. "pathname": "/",
  2477. "search": "",
  2478. "hash": ""
  2479. },
  2480. {
  2481. "input": "ftp://foo:80/",
  2482. "base": "about:blank",
  2483. "href": "ftp://foo:80/",
  2484. "origin": "ftp://foo:80",
  2485. "protocol": "ftp:",
  2486. "username": "",
  2487. "password": "",
  2488. "host": "foo:80",
  2489. "hostname": "foo",
  2490. "port": "80",
  2491. "pathname": "/",
  2492. "search": "",
  2493. "hash": ""
  2494. },
  2495. {
  2496. "input": "gopher://foo:70/",
  2497. "base": "about:blank",
  2498. "href": "gopher://foo/",
  2499. "origin": "gopher://foo",
  2500. "protocol": "gopher:",
  2501. "username": "",
  2502. "password": "",
  2503. "host": "foo",
  2504. "hostname": "foo",
  2505. "port": "",
  2506. "pathname": "/",
  2507. "search": "",
  2508. "hash": ""
  2509. },
  2510. {
  2511. "input": "gopher://foo:443/",
  2512. "base": "about:blank",
  2513. "href": "gopher://foo:443/",
  2514. "origin": "gopher://foo:443",
  2515. "protocol": "gopher:",
  2516. "username": "",
  2517. "password": "",
  2518. "host": "foo:443",
  2519. "hostname": "foo",
  2520. "port": "443",
  2521. "pathname": "/",
  2522. "search": "",
  2523. "hash": ""
  2524. },
  2525. {
  2526. "input": "ws://foo:80/",
  2527. "base": "about:blank",
  2528. "href": "ws://foo/",
  2529. "origin": "ws://foo",
  2530. "protocol": "ws:",
  2531. "username": "",
  2532. "password": "",
  2533. "host": "foo",
  2534. "hostname": "foo",
  2535. "port": "",
  2536. "pathname": "/",
  2537. "search": "",
  2538. "hash": ""
  2539. },
  2540. {
  2541. "input": "ws://foo:81/",
  2542. "base": "about:blank",
  2543. "href": "ws://foo:81/",
  2544. "origin": "ws://foo:81",
  2545. "protocol": "ws:",
  2546. "username": "",
  2547. "password": "",
  2548. "host": "foo:81",
  2549. "hostname": "foo",
  2550. "port": "81",
  2551. "pathname": "/",
  2552. "search": "",
  2553. "hash": ""
  2554. },
  2555. {
  2556. "input": "ws://foo:443/",
  2557. "base": "about:blank",
  2558. "href": "ws://foo:443/",
  2559. "origin": "ws://foo:443",
  2560. "protocol": "ws:",
  2561. "username": "",
  2562. "password": "",
  2563. "host": "foo:443",
  2564. "hostname": "foo",
  2565. "port": "443",
  2566. "pathname": "/",
  2567. "search": "",
  2568. "hash": ""
  2569. },
  2570. {
  2571. "input": "ws://foo:815/",
  2572. "base": "about:blank",
  2573. "href": "ws://foo:815/",
  2574. "origin": "ws://foo:815",
  2575. "protocol": "ws:",
  2576. "username": "",
  2577. "password": "",
  2578. "host": "foo:815",
  2579. "hostname": "foo",
  2580. "port": "815",
  2581. "pathname": "/",
  2582. "search": "",
  2583. "hash": ""
  2584. },
  2585. {
  2586. "input": "wss://foo:80/",
  2587. "base": "about:blank",
  2588. "href": "wss://foo:80/",
  2589. "origin": "wss://foo:80",
  2590. "protocol": "wss:",
  2591. "username": "",
  2592. "password": "",
  2593. "host": "foo:80",
  2594. "hostname": "foo",
  2595. "port": "80",
  2596. "pathname": "/",
  2597. "search": "",
  2598. "hash": ""
  2599. },
  2600. {
  2601. "input": "wss://foo:81/",
  2602. "base": "about:blank",
  2603. "href": "wss://foo:81/",
  2604. "origin": "wss://foo:81",
  2605. "protocol": "wss:",
  2606. "username": "",
  2607. "password": "",
  2608. "host": "foo:81",
  2609. "hostname": "foo",
  2610. "port": "81",
  2611. "pathname": "/",
  2612. "search": "",
  2613. "hash": ""
  2614. },
  2615. {
  2616. "input": "wss://foo:443/",
  2617. "base": "about:blank",
  2618. "href": "wss://foo/",
  2619. "origin": "wss://foo",
  2620. "protocol": "wss:",
  2621. "username": "",
  2622. "password": "",
  2623. "host": "foo",
  2624. "hostname": "foo",
  2625. "port": "",
  2626. "pathname": "/",
  2627. "search": "",
  2628. "hash": ""
  2629. },
  2630. {
  2631. "input": "wss://foo:815/",
  2632. "base": "about:blank",
  2633. "href": "wss://foo:815/",
  2634. "origin": "wss://foo:815",
  2635. "protocol": "wss:",
  2636. "username": "",
  2637. "password": "",
  2638. "host": "foo:815",
  2639. "hostname": "foo",
  2640. "port": "815",
  2641. "pathname": "/",
  2642. "search": "",
  2643. "hash": ""
  2644. },
  2645. {
  2646. "input": "http:/example.com/",
  2647. "base": "about:blank",
  2648. "href": "http://example.com/",
  2649. "origin": "http://example.com",
  2650. "protocol": "http:",
  2651. "username": "",
  2652. "password": "",
  2653. "host": "example.com",
  2654. "hostname": "example.com",
  2655. "port": "",
  2656. "pathname": "/",
  2657. "search": "",
  2658. "hash": ""
  2659. },
  2660. {
  2661. "input": "ftp:/example.com/",
  2662. "base": "about:blank",
  2663. "href": "ftp://example.com/",
  2664. "origin": "ftp://example.com",
  2665. "protocol": "ftp:",
  2666. "username": "",
  2667. "password": "",
  2668. "host": "example.com",
  2669. "hostname": "example.com",
  2670. "port": "",
  2671. "pathname": "/",
  2672. "search": "",
  2673. "hash": ""
  2674. },
  2675. {
  2676. "input": "https:/example.com/",
  2677. "base": "about:blank",
  2678. "href": "https://example.com/",
  2679. "origin": "https://example.com",
  2680. "protocol": "https:",
  2681. "username": "",
  2682. "password": "",
  2683. "host": "example.com",
  2684. "hostname": "example.com",
  2685. "port": "",
  2686. "pathname": "/",
  2687. "search": "",
  2688. "hash": ""
  2689. },
  2690. {
  2691. "input": "madeupscheme:/example.com/",
  2692. "base": "about:blank",
  2693. "href": "madeupscheme:/example.com/",
  2694. "origin": "null",
  2695. "protocol": "madeupscheme:",
  2696. "username": "",
  2697. "password": "",
  2698. "host": "",
  2699. "hostname": "",
  2700. "port": "",
  2701. "pathname": "/example.com/",
  2702. "search": "",
  2703. "hash": ""
  2704. },
  2705. {
  2706. "input": "file:/example.com/",
  2707. "base": "about:blank",
  2708. "href": "file:///example.com/",
  2709. "protocol": "file:",
  2710. "username": "",
  2711. "password": "",
  2712. "host": "",
  2713. "hostname": "",
  2714. "port": "",
  2715. "pathname": "/example.com/",
  2716. "search": "",
  2717. "hash": ""
  2718. },
  2719. {
  2720. "input": "ftps:/example.com/",
  2721. "base": "about:blank",
  2722. "href": "ftps:/example.com/",
  2723. "origin": "null",
  2724. "protocol": "ftps:",
  2725. "username": "",
  2726. "password": "",
  2727. "host": "",
  2728. "hostname": "",
  2729. "port": "",
  2730. "pathname": "/example.com/",
  2731. "search": "",
  2732. "hash": ""
  2733. },
  2734. {
  2735. "input": "gopher:/example.com/",
  2736. "base": "about:blank",
  2737. "href": "gopher://example.com/",
  2738. "origin": "gopher://example.com",
  2739. "protocol": "gopher:",
  2740. "username": "",
  2741. "password": "",
  2742. "host": "example.com",
  2743. "hostname": "example.com",
  2744. "port": "",
  2745. "pathname": "/",
  2746. "search": "",
  2747. "hash": ""
  2748. },
  2749. {
  2750. "input": "ws:/example.com/",
  2751. "base": "about:blank",
  2752. "href": "ws://example.com/",
  2753. "origin": "ws://example.com",
  2754. "protocol": "ws:",
  2755. "username": "",
  2756. "password": "",
  2757. "host": "example.com",
  2758. "hostname": "example.com",
  2759. "port": "",
  2760. "pathname": "/",
  2761. "search": "",
  2762. "hash": ""
  2763. },
  2764. {
  2765. "input": "wss:/example.com/",
  2766. "base": "about:blank",
  2767. "href": "wss://example.com/",
  2768. "origin": "wss://example.com",
  2769. "protocol": "wss:",
  2770. "username": "",
  2771. "password": "",
  2772. "host": "example.com",
  2773. "hostname": "example.com",
  2774. "port": "",
  2775. "pathname": "/",
  2776. "search": "",
  2777. "hash": ""
  2778. },
  2779. {
  2780. "input": "data:/example.com/",
  2781. "base": "about:blank",
  2782. "href": "data:/example.com/",
  2783. "origin": "null",
  2784. "protocol": "data:",
  2785. "username": "",
  2786. "password": "",
  2787. "host": "",
  2788. "hostname": "",
  2789. "port": "",
  2790. "pathname": "/example.com/",
  2791. "search": "",
  2792. "hash": ""
  2793. },
  2794. {
  2795. "input": "javascript:/example.com/",
  2796. "base": "about:blank",
  2797. "href": "javascript:/example.com/",
  2798. "origin": "null",
  2799. "protocol": "javascript:",
  2800. "username": "",
  2801. "password": "",
  2802. "host": "",
  2803. "hostname": "",
  2804. "port": "",
  2805. "pathname": "/example.com/",
  2806. "search": "",
  2807. "hash": ""
  2808. },
  2809. {
  2810. "input": "mailto:/example.com/",
  2811. "base": "about:blank",
  2812. "href": "mailto:/example.com/",
  2813. "origin": "null",
  2814. "protocol": "mailto:",
  2815. "username": "",
  2816. "password": "",
  2817. "host": "",
  2818. "hostname": "",
  2819. "port": "",
  2820. "pathname": "/example.com/",
  2821. "search": "",
  2822. "hash": ""
  2823. },
  2824. {
  2825. "input": "http:example.com/",
  2826. "base": "about:blank",
  2827. "href": "http://example.com/",
  2828. "origin": "http://example.com",
  2829. "protocol": "http:",
  2830. "username": "",
  2831. "password": "",
  2832. "host": "example.com",
  2833. "hostname": "example.com",
  2834. "port": "",
  2835. "pathname": "/",
  2836. "search": "",
  2837. "hash": ""
  2838. },
  2839. {
  2840. "input": "ftp:example.com/",
  2841. "base": "about:blank",
  2842. "href": "ftp://example.com/",
  2843. "origin": "ftp://example.com",
  2844. "protocol": "ftp:",
  2845. "username": "",
  2846. "password": "",
  2847. "host": "example.com",
  2848. "hostname": "example.com",
  2849. "port": "",
  2850. "pathname": "/",
  2851. "search": "",
  2852. "hash": ""
  2853. },
  2854. {
  2855. "input": "https:example.com/",
  2856. "base": "about:blank",
  2857. "href": "https://example.com/",
  2858. "origin": "https://example.com",
  2859. "protocol": "https:",
  2860. "username": "",
  2861. "password": "",
  2862. "host": "example.com",
  2863. "hostname": "example.com",
  2864. "port": "",
  2865. "pathname": "/",
  2866. "search": "",
  2867. "hash": ""
  2868. },
  2869. {
  2870. "input": "madeupscheme:example.com/",
  2871. "base": "about:blank",
  2872. "href": "madeupscheme:example.com/",
  2873. "origin": "null",
  2874. "protocol": "madeupscheme:",
  2875. "username": "",
  2876. "password": "",
  2877. "host": "",
  2878. "hostname": "",
  2879. "port": "",
  2880. "pathname": "example.com/",
  2881. "search": "",
  2882. "hash": ""
  2883. },
  2884. {
  2885. "input": "ftps:example.com/",
  2886. "base": "about:blank",
  2887. "href": "ftps:example.com/",
  2888. "origin": "null",
  2889. "protocol": "ftps:",
  2890. "username": "",
  2891. "password": "",
  2892. "host": "",
  2893. "hostname": "",
  2894. "port": "",
  2895. "pathname": "example.com/",
  2896. "search": "",
  2897. "hash": ""
  2898. },
  2899. {
  2900. "input": "gopher:example.com/",
  2901. "base": "about:blank",
  2902. "href": "gopher://example.com/",
  2903. "origin": "gopher://example.com",
  2904. "protocol": "gopher:",
  2905. "username": "",
  2906. "password": "",
  2907. "host": "example.com",
  2908. "hostname": "example.com",
  2909. "port": "",
  2910. "pathname": "/",
  2911. "search": "",
  2912. "hash": ""
  2913. },
  2914. {
  2915. "input": "ws:example.com/",
  2916. "base": "about:blank",
  2917. "href": "ws://example.com/",
  2918. "origin": "ws://example.com",
  2919. "protocol": "ws:",
  2920. "username": "",
  2921. "password": "",
  2922. "host": "example.com",
  2923. "hostname": "example.com",
  2924. "port": "",
  2925. "pathname": "/",
  2926. "search": "",
  2927. "hash": ""
  2928. },
  2929. {
  2930. "input": "wss:example.com/",
  2931. "base": "about:blank",
  2932. "href": "wss://example.com/",
  2933. "origin": "wss://example.com",
  2934. "protocol": "wss:",
  2935. "username": "",
  2936. "password": "",
  2937. "host": "example.com",
  2938. "hostname": "example.com",
  2939. "port": "",
  2940. "pathname": "/",
  2941. "search": "",
  2942. "hash": ""
  2943. },
  2944. {
  2945. "input": "data:example.com/",
  2946. "base": "about:blank",
  2947. "href": "data:example.com/",
  2948. "origin": "null",
  2949. "protocol": "data:",
  2950. "username": "",
  2951. "password": "",
  2952. "host": "",
  2953. "hostname": "",
  2954. "port": "",
  2955. "pathname": "example.com/",
  2956. "search": "",
  2957. "hash": ""
  2958. },
  2959. {
  2960. "input": "javascript:example.com/",
  2961. "base": "about:blank",
  2962. "href": "javascript:example.com/",
  2963. "origin": "null",
  2964. "protocol": "javascript:",
  2965. "username": "",
  2966. "password": "",
  2967. "host": "",
  2968. "hostname": "",
  2969. "port": "",
  2970. "pathname": "example.com/",
  2971. "search": "",
  2972. "hash": ""
  2973. },
  2974. {
  2975. "input": "mailto:example.com/",
  2976. "base": "about:blank",
  2977. "href": "mailto:example.com/",
  2978. "origin": "null",
  2979. "protocol": "mailto:",
  2980. "username": "",
  2981. "password": "",
  2982. "host": "",
  2983. "hostname": "",
  2984. "port": "",
  2985. "pathname": "example.com/",
  2986. "search": "",
  2987. "hash": ""
  2988. },
  2989. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
  2990. {
  2991. "input": "http:@www.example.com",
  2992. "base": "about:blank",
  2993. "href": "http://www.example.com/",
  2994. "origin": "http://www.example.com",
  2995. "protocol": "http:",
  2996. "username": "",
  2997. "password": "",
  2998. "host": "www.example.com",
  2999. "hostname": "www.example.com",
  3000. "port": "",
  3001. "pathname": "/",
  3002. "search": "",
  3003. "hash": ""
  3004. },
  3005. {
  3006. "input": "http:/@www.example.com",
  3007. "base": "about:blank",
  3008. "href": "http://www.example.com/",
  3009. "origin": "http://www.example.com",
  3010. "protocol": "http:",
  3011. "username": "",
  3012. "password": "",
  3013. "host": "www.example.com",
  3014. "hostname": "www.example.com",
  3015. "port": "",
  3016. "pathname": "/",
  3017. "search": "",
  3018. "hash": ""
  3019. },
  3020. {
  3021. "input": "http://@www.example.com",
  3022. "base": "about:blank",
  3023. "href": "http://www.example.com/",
  3024. "origin": "http://www.example.com",
  3025. "protocol": "http:",
  3026. "username": "",
  3027. "password": "",
  3028. "host": "www.example.com",
  3029. "hostname": "www.example.com",
  3030. "port": "",
  3031. "pathname": "/",
  3032. "search": "",
  3033. "hash": ""
  3034. },
  3035. {
  3036. "input": "http:a:b@www.example.com",
  3037. "base": "about:blank",
  3038. "href": "http://a:b@www.example.com/",
  3039. "origin": "http://www.example.com",
  3040. "protocol": "http:",
  3041. "username": "a",
  3042. "password": "b",
  3043. "host": "www.example.com",
  3044. "hostname": "www.example.com",
  3045. "port": "",
  3046. "pathname": "/",
  3047. "search": "",
  3048. "hash": ""
  3049. },
  3050. {
  3051. "input": "http:/a:b@www.example.com",
  3052. "base": "about:blank",
  3053. "href": "http://a:b@www.example.com/",
  3054. "origin": "http://www.example.com",
  3055. "protocol": "http:",
  3056. "username": "a",
  3057. "password": "b",
  3058. "host": "www.example.com",
  3059. "hostname": "www.example.com",
  3060. "port": "",
  3061. "pathname": "/",
  3062. "search": "",
  3063. "hash": ""
  3064. },
  3065. {
  3066. "input": "http://a:b@www.example.com",
  3067. "base": "about:blank",
  3068. "href": "http://a:b@www.example.com/",
  3069. "origin": "http://www.example.com",
  3070. "protocol": "http:",
  3071. "username": "a",
  3072. "password": "b",
  3073. "host": "www.example.com",
  3074. "hostname": "www.example.com",
  3075. "port": "",
  3076. "pathname": "/",
  3077. "search": "",
  3078. "hash": ""
  3079. },
  3080. {
  3081. "input": "http://@pple.com",
  3082. "base": "about:blank",
  3083. "href": "http://pple.com/",
  3084. "origin": "http://pple.com",
  3085. "protocol": "http:",
  3086. "username": "",
  3087. "password": "",
  3088. "host": "pple.com",
  3089. "hostname": "pple.com",
  3090. "port": "",
  3091. "pathname": "/",
  3092. "search": "",
  3093. "hash": ""
  3094. },
  3095. {
  3096. "input": "http::b@www.example.com",
  3097. "base": "about:blank",
  3098. "href": "http://:b@www.example.com/",
  3099. "origin": "http://www.example.com",
  3100. "protocol": "http:",
  3101. "username": "",
  3102. "password": "b",
  3103. "host": "www.example.com",
  3104. "hostname": "www.example.com",
  3105. "port": "",
  3106. "pathname": "/",
  3107. "search": "",
  3108. "hash": ""
  3109. },
  3110. {
  3111. "input": "http:/:b@www.example.com",
  3112. "base": "about:blank",
  3113. "href": "http://:b@www.example.com/",
  3114. "origin": "http://www.example.com",
  3115. "protocol": "http:",
  3116. "username": "",
  3117. "password": "b",
  3118. "host": "www.example.com",
  3119. "hostname": "www.example.com",
  3120. "port": "",
  3121. "pathname": "/",
  3122. "search": "",
  3123. "hash": ""
  3124. },
  3125. {
  3126. "input": "http://:b@www.example.com",
  3127. "base": "about:blank",
  3128. "href": "http://:b@www.example.com/",
  3129. "origin": "http://www.example.com",
  3130. "protocol": "http:",
  3131. "username": "",
  3132. "password": "b",
  3133. "host": "www.example.com",
  3134. "hostname": "www.example.com",
  3135. "port": "",
  3136. "pathname": "/",
  3137. "search": "",
  3138. "hash": ""
  3139. },
  3140. {
  3141. "input": "http:/:@/www.example.com",
  3142. "base": "about:blank",
  3143. "failure": true
  3144. },
  3145. {
  3146. "input": "http://user@/www.example.com",
  3147. "base": "about:blank",
  3148. "failure": true
  3149. },
  3150. {
  3151. "input": "http:@/www.example.com",
  3152. "base": "about:blank",
  3153. "failure": true
  3154. },
  3155. {
  3156. "input": "http:/@/www.example.com",
  3157. "base": "about:blank",
  3158. "failure": true
  3159. },
  3160. {
  3161. "input": "http://@/www.example.com",
  3162. "base": "about:blank",
  3163. "failure": true
  3164. },
  3165. {
  3166. "input": "https:@/www.example.com",
  3167. "base": "about:blank",
  3168. "failure": true
  3169. },
  3170. {
  3171. "input": "http:a:b@/www.example.com",
  3172. "base": "about:blank",
  3173. "failure": true
  3174. },
  3175. {
  3176. "input": "http:/a:b@/www.example.com",
  3177. "base": "about:blank",
  3178. "failure": true
  3179. },
  3180. {
  3181. "input": "http://a:b@/www.example.com",
  3182. "base": "about:blank",
  3183. "failure": true
  3184. },
  3185. {
  3186. "input": "http::@/www.example.com",
  3187. "base": "about:blank",
  3188. "failure": true
  3189. },
  3190. {
  3191. "input": "http:a:@www.example.com",
  3192. "base": "about:blank",
  3193. "href": "http://a@www.example.com/",
  3194. "origin": "http://www.example.com",
  3195. "protocol": "http:",
  3196. "username": "a",
  3197. "password": "",
  3198. "host": "www.example.com",
  3199. "hostname": "www.example.com",
  3200. "port": "",
  3201. "pathname": "/",
  3202. "search": "",
  3203. "hash": ""
  3204. },
  3205. {
  3206. "input": "http:/a:@www.example.com",
  3207. "base": "about:blank",
  3208. "href": "http://a@www.example.com/",
  3209. "origin": "http://www.example.com",
  3210. "protocol": "http:",
  3211. "username": "a",
  3212. "password": "",
  3213. "host": "www.example.com",
  3214. "hostname": "www.example.com",
  3215. "port": "",
  3216. "pathname": "/",
  3217. "search": "",
  3218. "hash": ""
  3219. },
  3220. {
  3221. "input": "http://a:@www.example.com",
  3222. "base": "about:blank",
  3223. "href": "http://a@www.example.com/",
  3224. "origin": "http://www.example.com",
  3225. "protocol": "http:",
  3226. "username": "a",
  3227. "password": "",
  3228. "host": "www.example.com",
  3229. "hostname": "www.example.com",
  3230. "port": "",
  3231. "pathname": "/",
  3232. "search": "",
  3233. "hash": ""
  3234. },
  3235. {
  3236. "input": "http://www.@pple.com",
  3237. "base": "about:blank",
  3238. "href": "http://www.@pple.com/",
  3239. "origin": "http://pple.com",
  3240. "protocol": "http:",
  3241. "username": "www.",
  3242. "password": "",
  3243. "host": "pple.com",
  3244. "hostname": "pple.com",
  3245. "port": "",
  3246. "pathname": "/",
  3247. "search": "",
  3248. "hash": ""
  3249. },
  3250. {
  3251. "input": "http:@:www.example.com",
  3252. "base": "about:blank",
  3253. "failure": true
  3254. },
  3255. {
  3256. "input": "http:/@:www.example.com",
  3257. "base": "about:blank",
  3258. "failure": true
  3259. },
  3260. {
  3261. "input": "http://@:www.example.com",
  3262. "base": "about:blank",
  3263. "failure": true
  3264. },
  3265. {
  3266. "input": "http://:@www.example.com",
  3267. "base": "about:blank",
  3268. "href": "http://www.example.com/",
  3269. "origin": "http://www.example.com",
  3270. "protocol": "http:",
  3271. "username": "",
  3272. "password": "",
  3273. "host": "www.example.com",
  3274. "hostname": "www.example.com",
  3275. "port": "",
  3276. "pathname": "/",
  3277. "search": "",
  3278. "hash": ""
  3279. },
  3280. "# Others",
  3281. {
  3282. "input": "/",
  3283. "base": "http://www.example.com/test",
  3284. "href": "http://www.example.com/",
  3285. "origin": "http://www.example.com",
  3286. "protocol": "http:",
  3287. "username": "",
  3288. "password": "",
  3289. "host": "www.example.com",
  3290. "hostname": "www.example.com",
  3291. "port": "",
  3292. "pathname": "/",
  3293. "search": "",
  3294. "hash": ""
  3295. },
  3296. {
  3297. "input": "/test.txt",
  3298. "base": "http://www.example.com/test",
  3299. "href": "http://www.example.com/test.txt",
  3300. "origin": "http://www.example.com",
  3301. "protocol": "http:",
  3302. "username": "",
  3303. "password": "",
  3304. "host": "www.example.com",
  3305. "hostname": "www.example.com",
  3306. "port": "",
  3307. "pathname": "/test.txt",
  3308. "search": "",
  3309. "hash": ""
  3310. },
  3311. {
  3312. "input": ".",
  3313. "base": "http://www.example.com/test",
  3314. "href": "http://www.example.com/",
  3315. "origin": "http://www.example.com",
  3316. "protocol": "http:",
  3317. "username": "",
  3318. "password": "",
  3319. "host": "www.example.com",
  3320. "hostname": "www.example.com",
  3321. "port": "",
  3322. "pathname": "/",
  3323. "search": "",
  3324. "hash": ""
  3325. },
  3326. {
  3327. "input": "..",
  3328. "base": "http://www.example.com/test",
  3329. "href": "http://www.example.com/",
  3330. "origin": "http://www.example.com",
  3331. "protocol": "http:",
  3332. "username": "",
  3333. "password": "",
  3334. "host": "www.example.com",
  3335. "hostname": "www.example.com",
  3336. "port": "",
  3337. "pathname": "/",
  3338. "search": "",
  3339. "hash": ""
  3340. },
  3341. {
  3342. "input": "test.txt",
  3343. "base": "http://www.example.com/test",
  3344. "href": "http://www.example.com/test.txt",
  3345. "origin": "http://www.example.com",
  3346. "protocol": "http:",
  3347. "username": "",
  3348. "password": "",
  3349. "host": "www.example.com",
  3350. "hostname": "www.example.com",
  3351. "port": "",
  3352. "pathname": "/test.txt",
  3353. "search": "",
  3354. "hash": ""
  3355. },
  3356. {
  3357. "input": "./test.txt",
  3358. "base": "http://www.example.com/test",
  3359. "href": "http://www.example.com/test.txt",
  3360. "origin": "http://www.example.com",
  3361. "protocol": "http:",
  3362. "username": "",
  3363. "password": "",
  3364. "host": "www.example.com",
  3365. "hostname": "www.example.com",
  3366. "port": "",
  3367. "pathname": "/test.txt",
  3368. "search": "",
  3369. "hash": ""
  3370. },
  3371. {
  3372. "input": "../test.txt",
  3373. "base": "http://www.example.com/test",
  3374. "href": "http://www.example.com/test.txt",
  3375. "origin": "http://www.example.com",
  3376. "protocol": "http:",
  3377. "username": "",
  3378. "password": "",
  3379. "host": "www.example.com",
  3380. "hostname": "www.example.com",
  3381. "port": "",
  3382. "pathname": "/test.txt",
  3383. "search": "",
  3384. "hash": ""
  3385. },
  3386. {
  3387. "input": "../aaa/test.txt",
  3388. "base": "http://www.example.com/test",
  3389. "href": "http://www.example.com/aaa/test.txt",
  3390. "origin": "http://www.example.com",
  3391. "protocol": "http:",
  3392. "username": "",
  3393. "password": "",
  3394. "host": "www.example.com",
  3395. "hostname": "www.example.com",
  3396. "port": "",
  3397. "pathname": "/aaa/test.txt",
  3398. "search": "",
  3399. "hash": ""
  3400. },
  3401. {
  3402. "input": "../../test.txt",
  3403. "base": "http://www.example.com/test",
  3404. "href": "http://www.example.com/test.txt",
  3405. "origin": "http://www.example.com",
  3406. "protocol": "http:",
  3407. "username": "",
  3408. "password": "",
  3409. "host": "www.example.com",
  3410. "hostname": "www.example.com",
  3411. "port": "",
  3412. "pathname": "/test.txt",
  3413. "search": "",
  3414. "hash": ""
  3415. },
  3416. {
  3417. "input": "中/test.txt",
  3418. "base": "http://www.example.com/test",
  3419. "href": "http://www.example.com/%E4%B8%AD/test.txt",
  3420. "origin": "http://www.example.com",
  3421. "protocol": "http:",
  3422. "username": "",
  3423. "password": "",
  3424. "host": "www.example.com",
  3425. "hostname": "www.example.com",
  3426. "port": "",
  3427. "pathname": "/%E4%B8%AD/test.txt",
  3428. "search": "",
  3429. "hash": ""
  3430. },
  3431. {
  3432. "input": "http://www.example2.com",
  3433. "base": "http://www.example.com/test",
  3434. "href": "http://www.example2.com/",
  3435. "origin": "http://www.example2.com",
  3436. "protocol": "http:",
  3437. "username": "",
  3438. "password": "",
  3439. "host": "www.example2.com",
  3440. "hostname": "www.example2.com",
  3441. "port": "",
  3442. "pathname": "/",
  3443. "search": "",
  3444. "hash": ""
  3445. },
  3446. {
  3447. "input": "//www.example2.com",
  3448. "base": "http://www.example.com/test",
  3449. "href": "http://www.example2.com/",
  3450. "origin": "http://www.example2.com",
  3451. "protocol": "http:",
  3452. "username": "",
  3453. "password": "",
  3454. "host": "www.example2.com",
  3455. "hostname": "www.example2.com",
  3456. "port": "",
  3457. "pathname": "/",
  3458. "search": "",
  3459. "hash": ""
  3460. },
  3461. {
  3462. "input": "file:...",
  3463. "base": "http://www.example.com/test",
  3464. "href": "file:///...",
  3465. "protocol": "file:",
  3466. "username": "",
  3467. "password": "",
  3468. "host": "",
  3469. "hostname": "",
  3470. "port": "",
  3471. "pathname": "/...",
  3472. "search": "",
  3473. "hash": ""
  3474. },
  3475. {
  3476. "input": "file:..",
  3477. "base": "http://www.example.com/test",
  3478. "href": "file:///",
  3479. "protocol": "file:",
  3480. "username": "",
  3481. "password": "",
  3482. "host": "",
  3483. "hostname": "",
  3484. "port": "",
  3485. "pathname": "/",
  3486. "search": "",
  3487. "hash": ""
  3488. },
  3489. {
  3490. "input": "file:a",
  3491. "base": "http://www.example.com/test",
  3492. "href": "file:///a",
  3493. "protocol": "file:",
  3494. "username": "",
  3495. "password": "",
  3496. "host": "",
  3497. "hostname": "",
  3498. "port": "",
  3499. "pathname": "/a",
  3500. "search": "",
  3501. "hash": ""
  3502. },
  3503. "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
  3504. "Basic canonicalization, uppercase should be converted to lowercase",
  3505. {
  3506. "input": "http://ExAmPlE.CoM",
  3507. "base": "http://other.com/",
  3508. "href": "http://example.com/",
  3509. "origin": "http://example.com",
  3510. "protocol": "http:",
  3511. "username": "",
  3512. "password": "",
  3513. "host": "example.com",
  3514. "hostname": "example.com",
  3515. "port": "",
  3516. "pathname": "/",
  3517. "search": "",
  3518. "hash": ""
  3519. },
  3520. {
  3521. "input": "http://example example.com",
  3522. "base": "http://other.com/",
  3523. "failure": true
  3524. },
  3525. {
  3526. "input": "http://Goo%20 goo%7C|.com",
  3527. "base": "http://other.com/",
  3528. "failure": true
  3529. },
  3530. {
  3531. "input": "http://[]",
  3532. "base": "http://other.com/",
  3533. "failure": true
  3534. },
  3535. {
  3536. "input": "http://[:]",
  3537. "base": "http://other.com/",
  3538. "failure": true
  3539. },
  3540. "U+3000 is mapped to U+0020 (space) which is disallowed",
  3541. {
  3542. "input": "http://GOO\u00a0\u3000goo.com",
  3543. "base": "http://other.com/",
  3544. "failure": true
  3545. },
  3546. "Other types of space (no-break, zero-width, zero-width-no-break) are name-prepped away to nothing. U+200B, U+2060, and U+FEFF, are ignored",
  3547. {
  3548. "input": "http://GOO\u200b\u2060\ufeffgoo.com",
  3549. "base": "http://other.com/",
  3550. "href": "http://googoo.com/",
  3551. "origin": "http://googoo.com",
  3552. "protocol": "http:",
  3553. "username": "",
  3554. "password": "",
  3555. "host": "googoo.com",
  3556. "hostname": "googoo.com",
  3557. "port": "",
  3558. "pathname": "/",
  3559. "search": "",
  3560. "hash": ""
  3561. },
  3562. "Leading and trailing C0 control or space",
  3563. {
  3564. "input": "\u0000\u001b\u0004\u0012 http://example.com/\u001f \u000d ",
  3565. "base": "about:blank",
  3566. "href": "http://example.com/",
  3567. "origin": "http://example.com",
  3568. "protocol": "http:",
  3569. "username": "",
  3570. "password": "",
  3571. "host": "example.com",
  3572. "hostname": "example.com",
  3573. "port": "",
  3574. "pathname": "/",
  3575. "search": "",
  3576. "hash": ""
  3577. },
  3578. "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
  3579. {
  3580. "input": "http://www.foo。bar.com",
  3581. "base": "http://other.com/",
  3582. "href": "http://www.foo.bar.com/",
  3583. "origin": "http://www.foo.bar.com",
  3584. "protocol": "http:",
  3585. "username": "",
  3586. "password": "",
  3587. "host": "www.foo.bar.com",
  3588. "hostname": "www.foo.bar.com",
  3589. "port": "",
  3590. "pathname": "/",
  3591. "search": "",
  3592. "hash": ""
  3593. },
  3594. "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
  3595. {
  3596. "input": "http://\ufdd0zyx.com",
  3597. "base": "http://other.com/",
  3598. "failure": true
  3599. },
  3600. "This is the same as previous but escaped",
  3601. {
  3602. "input": "http://%ef%b7%90zyx.com",
  3603. "base": "http://other.com/",
  3604. "failure": true
  3605. },
  3606. "U+FFFD",
  3607. {
  3608. "input": "https://\ufffd",
  3609. "base": "about:blank",
  3610. "failure": true
  3611. },
  3612. {
  3613. "input": "https://%EF%BF%BD",
  3614. "base": "about:blank",
  3615. "failure": true
  3616. },
  3617. {
  3618. "input": "https://x/\ufffd?\ufffd#\ufffd",
  3619. "base": "about:blank",
  3620. "href": "https://x/%EF%BF%BD?%EF%BF%BD#%EF%BF%BD",
  3621. "origin": "https://x",
  3622. "protocol": "https:",
  3623. "username": "",
  3624. "password": "",
  3625. "host": "x",
  3626. "hostname": "x",
  3627. "port": "",
  3628. "pathname": "/%EF%BF%BD",
  3629. "search": "?%EF%BF%BD",
  3630. "hash": "#%EF%BF%BD"
  3631. },
  3632. "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
  3633. {
  3634. "input": "http://Go.com",
  3635. "base": "http://other.com/",
  3636. "href": "http://go.com/",
  3637. "origin": "http://go.com",
  3638. "protocol": "http:",
  3639. "username": "",
  3640. "password": "",
  3641. "host": "go.com",
  3642. "hostname": "go.com",
  3643. "port": "",
  3644. "pathname": "/",
  3645. "search": "",
  3646. "hash": ""
  3647. },
  3648. "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
  3649. {
  3650. "input": "http://%41.com",
  3651. "base": "http://other.com/",
  3652. "failure": true
  3653. },
  3654. {
  3655. "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
  3656. "base": "http://other.com/",
  3657. "failure": true
  3658. },
  3659. "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
  3660. {
  3661. "input": "http://%00.com",
  3662. "base": "http://other.com/",
  3663. "failure": true
  3664. },
  3665. {
  3666. "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
  3667. "base": "http://other.com/",
  3668. "failure": true
  3669. },
  3670. "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
  3671. {
  3672. "input": "http://你好你好",
  3673. "base": "http://other.com/",
  3674. "href": "http://xn--6qqa088eba/",
  3675. "origin": "http://xn--6qqa088eba",
  3676. "protocol": "http:",
  3677. "username": "",
  3678. "password": "",
  3679. "host": "xn--6qqa088eba",
  3680. "hostname": "xn--6qqa088eba",
  3681. "port": "",
  3682. "pathname": "/",
  3683. "search": "",
  3684. "hash": ""
  3685. },
  3686. {
  3687. "input": "https://faß.ExAmPlE/",
  3688. "base": "about:blank",
  3689. "href": "https://xn--fa-hia.example/",
  3690. "origin": "https://xn--fa-hia.example",
  3691. "protocol": "https:",
  3692. "username": "",
  3693. "password": "",
  3694. "host": "xn--fa-hia.example",
  3695. "hostname": "xn--fa-hia.example",
  3696. "port": "",
  3697. "pathname": "/",
  3698. "search": "",
  3699. "hash": ""
  3700. },
  3701. {
  3702. "input": "sc://faß.ExAmPlE/",
  3703. "base": "about:blank",
  3704. "href": "sc://fa%C3%9F.ExAmPlE/",
  3705. "origin": "null",
  3706. "protocol": "sc:",
  3707. "username": "",
  3708. "password": "",
  3709. "host": "fa%C3%9F.ExAmPlE",
  3710. "hostname": "fa%C3%9F.ExAmPlE",
  3711. "port": "",
  3712. "pathname": "/",
  3713. "search": "",
  3714. "hash": ""
  3715. },
  3716. "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
  3717. {
  3718. "input": "http://%zz%66%a.com",
  3719. "base": "http://other.com/",
  3720. "failure": true
  3721. },
  3722. "If we get an invalid character that has been escaped.",
  3723. {
  3724. "input": "http://%25",
  3725. "base": "http://other.com/",
  3726. "failure": true
  3727. },
  3728. {
  3729. "input": "http://hello%00",
  3730. "base": "http://other.com/",
  3731. "failure": true
  3732. },
  3733. "Escaped numbers should be treated like IP addresses if they are.",
  3734. {
  3735. "input": "http://%30%78%63%30%2e%30%32%35%30.01",
  3736. "base": "http://other.com/",
  3737. "href": "http://192.168.0.1/",
  3738. "origin": "http://192.168.0.1",
  3739. "protocol": "http:",
  3740. "username": "",
  3741. "password": "",
  3742. "host": "192.168.0.1",
  3743. "hostname": "192.168.0.1",
  3744. "port": "",
  3745. "pathname": "/",
  3746. "search": "",
  3747. "hash": ""
  3748. },
  3749. {
  3750. "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
  3751. "base": "http://other.com/",
  3752. "href": "http://192.168.0.1/",
  3753. "origin": "http://192.168.0.1",
  3754. "protocol": "http:",
  3755. "username": "",
  3756. "password": "",
  3757. "host": "192.168.0.1",
  3758. "hostname": "192.168.0.1",
  3759. "port": "",
  3760. "pathname": "/",
  3761. "search": "",
  3762. "hash": ""
  3763. },
  3764. {
  3765. "input": "http://192.168.0.257",
  3766. "base": "http://other.com/",
  3767. "failure": true
  3768. },
  3769. "Invalid escaping in hosts causes failure",
  3770. {
  3771. "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
  3772. "base": "http://other.com/",
  3773. "failure": true
  3774. },
  3775. "A space in a host causes failure",
  3776. {
  3777. "input": "http://192.168.0.1 hello",
  3778. "base": "http://other.com/",
  3779. "failure": true
  3780. },
  3781. {
  3782. "input": "https://x x:12",
  3783. "base": "about:blank",
  3784. "failure": true
  3785. },
  3786. "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
  3787. {
  3788. "input": "http://0Xc0.0250.01",
  3789. "base": "http://other.com/",
  3790. "href": "http://192.168.0.1/",
  3791. "origin": "http://192.168.0.1",
  3792. "protocol": "http:",
  3793. "username": "",
  3794. "password": "",
  3795. "host": "192.168.0.1",
  3796. "hostname": "192.168.0.1",
  3797. "port": "",
  3798. "pathname": "/",
  3799. "search": "",
  3800. "hash": ""
  3801. },
  3802. "Domains with empty labels",
  3803. {
  3804. "input": "http://./",
  3805. "base": "about:blank",
  3806. "href": "http://./",
  3807. "origin": "http://.",
  3808. "protocol": "http:",
  3809. "username": "",
  3810. "password": "",
  3811. "host": ".",
  3812. "hostname": ".",
  3813. "port": "",
  3814. "pathname": "/",
  3815. "search": "",
  3816. "hash": ""
  3817. },
  3818. {
  3819. "input": "http://../",
  3820. "base": "about:blank",
  3821. "href": "http://../",
  3822. "origin": "http://..",
  3823. "protocol": "http:",
  3824. "username": "",
  3825. "password": "",
  3826. "host": "..",
  3827. "hostname": "..",
  3828. "port": "",
  3829. "pathname": "/",
  3830. "search": "",
  3831. "hash": ""
  3832. },
  3833. {
  3834. "input": "http://0..0x300/",
  3835. "base": "about:blank",
  3836. "href": "http://0..0x300/",
  3837. "origin": "http://0..0x300",
  3838. "protocol": "http:",
  3839. "username": "",
  3840. "password": "",
  3841. "host": "0..0x300",
  3842. "hostname": "0..0x300",
  3843. "port": "",
  3844. "pathname": "/",
  3845. "search": "",
  3846. "hash": ""
  3847. },
  3848. "Broken IPv6",
  3849. {
  3850. "input": "http://[www.google.com]/",
  3851. "base": "about:blank",
  3852. "failure": true
  3853. },
  3854. {
  3855. "input": "http://[google.com]",
  3856. "base": "http://other.com/",
  3857. "failure": true
  3858. },
  3859. {
  3860. "input": "http://[::1.2.3.4x]",
  3861. "base": "http://other.com/",
  3862. "failure": true
  3863. },
  3864. {
  3865. "input": "http://[::1.2.3.]",
  3866. "base": "http://other.com/",
  3867. "failure": true
  3868. },
  3869. {
  3870. "input": "http://[::1.2.]",
  3871. "base": "http://other.com/",
  3872. "failure": true
  3873. },
  3874. {
  3875. "input": "http://[::1.]",
  3876. "base": "http://other.com/",
  3877. "failure": true
  3878. },
  3879. "Misc Unicode",
  3880. {
  3881. "input": "http://foo:💩@example.com/bar",
  3882. "base": "http://other.com/",
  3883. "href": "http://foo:%F0%9F%92%A9@example.com/bar",
  3884. "origin": "http://example.com",
  3885. "protocol": "http:",
  3886. "username": "foo",
  3887. "password": "%F0%9F%92%A9",
  3888. "host": "example.com",
  3889. "hostname": "example.com",
  3890. "port": "",
  3891. "pathname": "/bar",
  3892. "search": "",
  3893. "hash": ""
  3894. },
  3895. "# resolving a fragment against any scheme succeeds",
  3896. {
  3897. "input": "#",
  3898. "base": "test:test",
  3899. "href": "test:test#",
  3900. "origin": "null",
  3901. "protocol": "test:",
  3902. "username": "",
  3903. "password": "",
  3904. "host": "",
  3905. "hostname": "",
  3906. "port": "",
  3907. "pathname": "test",
  3908. "search": "",
  3909. "hash": ""
  3910. },
  3911. {
  3912. "input": "#x",
  3913. "base": "mailto:x@x.com",
  3914. "href": "mailto:x@x.com#x",
  3915. "origin": "null",
  3916. "protocol": "mailto:",
  3917. "username": "",
  3918. "password": "",
  3919. "host": "",
  3920. "hostname": "",
  3921. "port": "",
  3922. "pathname": "x@x.com",
  3923. "search": "",
  3924. "hash": "#x"
  3925. },
  3926. {
  3927. "input": "#x",
  3928. "base": "data:,",
  3929. "href": "data:,#x",
  3930. "origin": "null",
  3931. "protocol": "data:",
  3932. "username": "",
  3933. "password": "",
  3934. "host": "",
  3935. "hostname": "",
  3936. "port": "",
  3937. "pathname": ",",
  3938. "search": "",
  3939. "hash": "#x"
  3940. },
  3941. {
  3942. "input": "#x",
  3943. "base": "about:blank",
  3944. "href": "about:blank#x",
  3945. "origin": "null",
  3946. "protocol": "about:",
  3947. "username": "",
  3948. "password": "",
  3949. "host": "",
  3950. "hostname": "",
  3951. "port": "",
  3952. "pathname": "blank",
  3953. "search": "",
  3954. "hash": "#x"
  3955. },
  3956. {
  3957. "input": "#",
  3958. "base": "test:test?test",
  3959. "href": "test:test?test#",
  3960. "origin": "null",
  3961. "protocol": "test:",
  3962. "username": "",
  3963. "password": "",
  3964. "host": "",
  3965. "hostname": "",
  3966. "port": "",
  3967. "pathname": "test",
  3968. "search": "?test",
  3969. "hash": ""
  3970. },
  3971. "# multiple @ in authority state",
  3972. {
  3973. "input": "https://@test@test@example:800/",
  3974. "base": "http://doesnotmatter/",
  3975. "href": "https://%40test%40test@example:800/",
  3976. "origin": "https://example:800",
  3977. "protocol": "https:",
  3978. "username": "%40test%40test",
  3979. "password": "",
  3980. "host": "example:800",
  3981. "hostname": "example",
  3982. "port": "800",
  3983. "pathname": "/",
  3984. "search": "",
  3985. "hash": ""
  3986. },
  3987. {
  3988. "input": "https://@@@example",
  3989. "base": "http://doesnotmatter/",
  3990. "href": "https://%40%40@example/",
  3991. "origin": "https://example",
  3992. "protocol": "https:",
  3993. "username": "%40%40",
  3994. "password": "",
  3995. "host": "example",
  3996. "hostname": "example",
  3997. "port": "",
  3998. "pathname": "/",
  3999. "search": "",
  4000. "hash": ""
  4001. },
  4002. "non-az-09 characters",
  4003. {
  4004. "input": "http://`{}:`{}@h/`{}?`{}",
  4005. "base": "http://doesnotmatter/",
  4006. "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
  4007. "origin": "http://h",
  4008. "protocol": "http:",
  4009. "username": "%60%7B%7D",
  4010. "password": "%60%7B%7D",
  4011. "host": "h",
  4012. "hostname": "h",
  4013. "port": "",
  4014. "pathname": "/%60%7B%7D",
  4015. "search": "?`{}",
  4016. "hash": ""
  4017. },
  4018. "# Credentials in base",
  4019. {
  4020. "input": "/some/path",
  4021. "base": "http://user@example.org/smth",
  4022. "href": "http://user@example.org/some/path",
  4023. "origin": "http://example.org",
  4024. "protocol": "http:",
  4025. "username": "user",
  4026. "password": "",
  4027. "host": "example.org",
  4028. "hostname": "example.org",
  4029. "port": "",
  4030. "pathname": "/some/path",
  4031. "search": "",
  4032. "hash": ""
  4033. },
  4034. {
  4035. "input": "",
  4036. "base": "http://user:pass@example.org:21/smth",
  4037. "href": "http://user:pass@example.org:21/smth",
  4038. "origin": "http://example.org:21",
  4039. "protocol": "http:",
  4040. "username": "user",
  4041. "password": "pass",
  4042. "host": "example.org:21",
  4043. "hostname": "example.org",
  4044. "port": "21",
  4045. "pathname": "/smth",
  4046. "search": "",
  4047. "hash": ""
  4048. },
  4049. {
  4050. "input": "/some/path",
  4051. "base": "http://user:pass@example.org:21/smth",
  4052. "href": "http://user:pass@example.org:21/some/path",
  4053. "origin": "http://example.org:21",
  4054. "protocol": "http:",
  4055. "username": "user",
  4056. "password": "pass",
  4057. "host": "example.org:21",
  4058. "hostname": "example.org",
  4059. "port": "21",
  4060. "pathname": "/some/path",
  4061. "search": "",
  4062. "hash": ""
  4063. },
  4064. "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
  4065. {
  4066. "input": "i",
  4067. "base": "sc:sd",
  4068. "failure": true
  4069. },
  4070. {
  4071. "input": "i",
  4072. "base": "sc:sd/sd",
  4073. "failure": true
  4074. },
  4075. {
  4076. "input": "i",
  4077. "base": "sc:/pa/pa",
  4078. "href": "sc:/pa/i",
  4079. "origin": "null",
  4080. "protocol": "sc:",
  4081. "username": "",
  4082. "password": "",
  4083. "host": "",
  4084. "hostname": "",
  4085. "port": "",
  4086. "pathname": "/pa/i",
  4087. "search": "",
  4088. "hash": ""
  4089. },
  4090. {
  4091. "input": "i",
  4092. "base": "sc://ho/pa",
  4093. "href": "sc://ho/i",
  4094. "origin": "null",
  4095. "protocol": "sc:",
  4096. "username": "",
  4097. "password": "",
  4098. "host": "ho",
  4099. "hostname": "ho",
  4100. "port": "",
  4101. "pathname": "/i",
  4102. "search": "",
  4103. "hash": ""
  4104. },
  4105. {
  4106. "input": "i",
  4107. "base": "sc:///pa/pa",
  4108. "href": "sc:///pa/i",
  4109. "origin": "null",
  4110. "protocol": "sc:",
  4111. "username": "",
  4112. "password": "",
  4113. "host": "",
  4114. "hostname": "",
  4115. "port": "",
  4116. "pathname": "/pa/i",
  4117. "search": "",
  4118. "hash": ""
  4119. },
  4120. {
  4121. "input": "../i",
  4122. "base": "sc:sd",
  4123. "failure": true
  4124. },
  4125. {
  4126. "input": "../i",
  4127. "base": "sc:sd/sd",
  4128. "failure": true
  4129. },
  4130. {
  4131. "input": "../i",
  4132. "base": "sc:/pa/pa",
  4133. "href": "sc:/i",
  4134. "origin": "null",
  4135. "protocol": "sc:",
  4136. "username": "",
  4137. "password": "",
  4138. "host": "",
  4139. "hostname": "",
  4140. "port": "",
  4141. "pathname": "/i",
  4142. "search": "",
  4143. "hash": ""
  4144. },
  4145. {
  4146. "input": "../i",
  4147. "base": "sc://ho/pa",
  4148. "href": "sc://ho/i",
  4149. "origin": "null",
  4150. "protocol": "sc:",
  4151. "username": "",
  4152. "password": "",
  4153. "host": "ho",
  4154. "hostname": "ho",
  4155. "port": "",
  4156. "pathname": "/i",
  4157. "search": "",
  4158. "hash": ""
  4159. },
  4160. {
  4161. "input": "../i",
  4162. "base": "sc:///pa/pa",
  4163. "href": "sc:///i",
  4164. "origin": "null",
  4165. "protocol": "sc:",
  4166. "username": "",
  4167. "password": "",
  4168. "host": "",
  4169. "hostname": "",
  4170. "port": "",
  4171. "pathname": "/i",
  4172. "search": "",
  4173. "hash": ""
  4174. },
  4175. {
  4176. "input": "/i",
  4177. "base": "sc:sd",
  4178. "failure": true
  4179. },
  4180. {
  4181. "input": "/i",
  4182. "base": "sc:sd/sd",
  4183. "failure": true
  4184. },
  4185. {
  4186. "input": "/i",
  4187. "base": "sc:/pa/pa",
  4188. "href": "sc:/i",
  4189. "origin": "null",
  4190. "protocol": "sc:",
  4191. "username": "",
  4192. "password": "",
  4193. "host": "",
  4194. "hostname": "",
  4195. "port": "",
  4196. "pathname": "/i",
  4197. "search": "",
  4198. "hash": ""
  4199. },
  4200. {
  4201. "input": "/i",
  4202. "base": "sc://ho/pa",
  4203. "href": "sc://ho/i",
  4204. "origin": "null",
  4205. "protocol": "sc:",
  4206. "username": "",
  4207. "password": "",
  4208. "host": "ho",
  4209. "hostname": "ho",
  4210. "port": "",
  4211. "pathname": "/i",
  4212. "search": "",
  4213. "hash": ""
  4214. },
  4215. {
  4216. "input": "/i",
  4217. "base": "sc:///pa/pa",
  4218. "href": "sc:///i",
  4219. "origin": "null",
  4220. "protocol": "sc:",
  4221. "username": "",
  4222. "password": "",
  4223. "host": "",
  4224. "hostname": "",
  4225. "port": "",
  4226. "pathname": "/i",
  4227. "search": "",
  4228. "hash": ""
  4229. },
  4230. {
  4231. "input": "?i",
  4232. "base": "sc:sd",
  4233. "failure": true
  4234. },
  4235. {
  4236. "input": "?i",
  4237. "base": "sc:sd/sd",
  4238. "failure": true
  4239. },
  4240. {
  4241. "input": "?i",
  4242. "base": "sc:/pa/pa",
  4243. "href": "sc:/pa/pa?i",
  4244. "origin": "null",
  4245. "protocol": "sc:",
  4246. "username": "",
  4247. "password": "",
  4248. "host": "",
  4249. "hostname": "",
  4250. "port": "",
  4251. "pathname": "/pa/pa",
  4252. "search": "?i",
  4253. "hash": ""
  4254. },
  4255. {
  4256. "input": "?i",
  4257. "base": "sc://ho/pa",
  4258. "href": "sc://ho/pa?i",
  4259. "origin": "null",
  4260. "protocol": "sc:",
  4261. "username": "",
  4262. "password": "",
  4263. "host": "ho",
  4264. "hostname": "ho",
  4265. "port": "",
  4266. "pathname": "/pa",
  4267. "search": "?i",
  4268. "hash": ""
  4269. },
  4270. {
  4271. "input": "?i",
  4272. "base": "sc:///pa/pa",
  4273. "href": "sc:///pa/pa?i",
  4274. "origin": "null",
  4275. "protocol": "sc:",
  4276. "username": "",
  4277. "password": "",
  4278. "host": "",
  4279. "hostname": "",
  4280. "port": "",
  4281. "pathname": "/pa/pa",
  4282. "search": "?i",
  4283. "hash": ""
  4284. },
  4285. {
  4286. "input": "#i",
  4287. "base": "sc:sd",
  4288. "href": "sc:sd#i",
  4289. "origin": "null",
  4290. "protocol": "sc:",
  4291. "username": "",
  4292. "password": "",
  4293. "host": "",
  4294. "hostname": "",
  4295. "port": "",
  4296. "pathname": "sd",
  4297. "search": "",
  4298. "hash": "#i"
  4299. },
  4300. {
  4301. "input": "#i",
  4302. "base": "sc:sd/sd",
  4303. "href": "sc:sd/sd#i",
  4304. "origin": "null",
  4305. "protocol": "sc:",
  4306. "username": "",
  4307. "password": "",
  4308. "host": "",
  4309. "hostname": "",
  4310. "port": "",
  4311. "pathname": "sd/sd",
  4312. "search": "",
  4313. "hash": "#i"
  4314. },
  4315. {
  4316. "input": "#i",
  4317. "base": "sc:/pa/pa",
  4318. "href": "sc:/pa/pa#i",
  4319. "origin": "null",
  4320. "protocol": "sc:",
  4321. "username": "",
  4322. "password": "",
  4323. "host": "",
  4324. "hostname": "",
  4325. "port": "",
  4326. "pathname": "/pa/pa",
  4327. "search": "",
  4328. "hash": "#i"
  4329. },
  4330. {
  4331. "input": "#i",
  4332. "base": "sc://ho/pa",
  4333. "href": "sc://ho/pa#i",
  4334. "origin": "null",
  4335. "protocol": "sc:",
  4336. "username": "",
  4337. "password": "",
  4338. "host": "ho",
  4339. "hostname": "ho",
  4340. "port": "",
  4341. "pathname": "/pa",
  4342. "search": "",
  4343. "hash": "#i"
  4344. },
  4345. {
  4346. "input": "#i",
  4347. "base": "sc:///pa/pa",
  4348. "href": "sc:///pa/pa#i",
  4349. "origin": "null",
  4350. "protocol": "sc:",
  4351. "username": "",
  4352. "password": "",
  4353. "host": "",
  4354. "hostname": "",
  4355. "port": "",
  4356. "pathname": "/pa/pa",
  4357. "search": "",
  4358. "hash": "#i"
  4359. },
  4360. "# make sure that relative URL logic works on known typically non-relative schemes too",
  4361. {
  4362. "input": "about:/../",
  4363. "base": "about:blank",
  4364. "href": "about:/",
  4365. "origin": "null",
  4366. "protocol": "about:",
  4367. "username": "",
  4368. "password": "",
  4369. "host": "",
  4370. "hostname": "",
  4371. "port": "",
  4372. "pathname": "/",
  4373. "search": "",
  4374. "hash": ""
  4375. },
  4376. {
  4377. "input": "data:/../",
  4378. "base": "about:blank",
  4379. "href": "data:/",
  4380. "origin": "null",
  4381. "protocol": "data:",
  4382. "username": "",
  4383. "password": "",
  4384. "host": "",
  4385. "hostname": "",
  4386. "port": "",
  4387. "pathname": "/",
  4388. "search": "",
  4389. "hash": ""
  4390. },
  4391. {
  4392. "input": "javascript:/../",
  4393. "base": "about:blank",
  4394. "href": "javascript:/",
  4395. "origin": "null",
  4396. "protocol": "javascript:",
  4397. "username": "",
  4398. "password": "",
  4399. "host": "",
  4400. "hostname": "",
  4401. "port": "",
  4402. "pathname": "/",
  4403. "search": "",
  4404. "hash": ""
  4405. },
  4406. {
  4407. "input": "mailto:/../",
  4408. "base": "about:blank",
  4409. "href": "mailto:/",
  4410. "origin": "null",
  4411. "protocol": "mailto:",
  4412. "username": "",
  4413. "password": "",
  4414. "host": "",
  4415. "hostname": "",
  4416. "port": "",
  4417. "pathname": "/",
  4418. "search": "",
  4419. "hash": ""
  4420. },
  4421. "# unknown schemes and their hosts",
  4422. {
  4423. "input": "sc://ñ.test/",
  4424. "base": "about:blank",
  4425. "href": "sc://%C3%B1.test/",
  4426. "origin": "null",
  4427. "protocol": "sc:",
  4428. "username": "",
  4429. "password": "",
  4430. "host": "%C3%B1.test",
  4431. "hostname": "%C3%B1.test",
  4432. "port": "",
  4433. "pathname": "/",
  4434. "search": "",
  4435. "hash": ""
  4436. },
  4437. {
  4438. "input": "sc://\u001F!\"$&'()*+,-.;<=>^_`{|}~/",
  4439. "base": "about:blank",
  4440. "href": "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/",
  4441. "origin": "null",
  4442. "protocol": "sc:",
  4443. "username": "",
  4444. "password": "",
  4445. "host": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
  4446. "hostname": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
  4447. "port": "",
  4448. "pathname": "/",
  4449. "search": "",
  4450. "hash": ""
  4451. },
  4452. {
  4453. "input": "sc://\u0000/",
  4454. "base": "about:blank",
  4455. "failure": true
  4456. },
  4457. {
  4458. "input": "sc:// /",
  4459. "base": "about:blank",
  4460. "failure": true
  4461. },
  4462. {
  4463. "input": "sc://%/",
  4464. "base": "about:blank",
  4465. "href": "sc://%/",
  4466. "protocol": "sc:",
  4467. "username": "",
  4468. "password": "",
  4469. "host": "%",
  4470. "hostname": "%",
  4471. "port": "",
  4472. "pathname": "/",
  4473. "search": "",
  4474. "hash": ""
  4475. },
  4476. {
  4477. "input": "sc://[/",
  4478. "base": "about:blank",
  4479. "failure": true
  4480. },
  4481. {
  4482. "input": "sc://\\/",
  4483. "base": "about:blank",
  4484. "failure": true
  4485. },
  4486. {
  4487. "input": "sc://]/",
  4488. "base": "about:blank",
  4489. "failure": true
  4490. },
  4491. {
  4492. "input": "x",
  4493. "base": "sc://ñ",
  4494. "href": "sc://%C3%B1/x",
  4495. "origin": "null",
  4496. "protocol": "sc:",
  4497. "username": "",
  4498. "password": "",
  4499. "host": "%C3%B1",
  4500. "hostname": "%C3%B1",
  4501. "port": "",
  4502. "pathname": "/x",
  4503. "search": "",
  4504. "hash": ""
  4505. },
  4506. "# unknown schemes and backslashes",
  4507. {
  4508. "input": "sc:\\../",
  4509. "base": "about:blank",
  4510. "href": "sc:\\../",
  4511. "origin": "null",
  4512. "protocol": "sc:",
  4513. "username": "",
  4514. "password": "",
  4515. "host": "",
  4516. "hostname": "",
  4517. "port": "",
  4518. "pathname": "\\../",
  4519. "search": "",
  4520. "hash": ""
  4521. },
  4522. "# unknown scheme with path looking like a password",
  4523. {
  4524. "input": "sc::a@example.net",
  4525. "base": "about:blank",
  4526. "href": "sc::a@example.net",
  4527. "origin": "null",
  4528. "protocol": "sc:",
  4529. "username": "",
  4530. "password": "",
  4531. "host": "",
  4532. "hostname": "",
  4533. "port": "",
  4534. "pathname": ":a@example.net",
  4535. "search": "",
  4536. "hash": ""
  4537. },
  4538. "# unknown scheme with bogus percent-encoding",
  4539. {
  4540. "input": "wow:%NBD",
  4541. "base": "about:blank",
  4542. "href": "wow:%NBD",
  4543. "origin": "null",
  4544. "protocol": "wow:",
  4545. "username": "",
  4546. "password": "",
  4547. "host": "",
  4548. "hostname": "",
  4549. "port": "",
  4550. "pathname": "%NBD",
  4551. "search": "",
  4552. "hash": ""
  4553. },
  4554. {
  4555. "input": "wow:%1G",
  4556. "base": "about:blank",
  4557. "href": "wow:%1G",
  4558. "origin": "null",
  4559. "protocol": "wow:",
  4560. "username": "",
  4561. "password": "",
  4562. "host": "",
  4563. "hostname": "",
  4564. "port": "",
  4565. "pathname": "%1G",
  4566. "search": "",
  4567. "hash": ""
  4568. },
  4569. "# Hosts and percent-encoding",
  4570. {
  4571. "input": "ftp://example.com%80/",
  4572. "base": "about:blank",
  4573. "failure": true
  4574. },
  4575. {
  4576. "input": "ftp://example.com%A0/",
  4577. "base": "about:blank",
  4578. "failure": true
  4579. },
  4580. {
  4581. "input": "https://example.com%80/",
  4582. "base": "about:blank",
  4583. "failure": true
  4584. },
  4585. {
  4586. "input": "https://example.com%A0/",
  4587. "base": "about:blank",
  4588. "failure": true
  4589. },
  4590. {
  4591. "input": "ftp://%e2%98%83",
  4592. "base": "about:blank",
  4593. "href": "ftp://xn--n3h/",
  4594. "origin": "ftp://xn--n3h",
  4595. "protocol": "ftp:",
  4596. "username": "",
  4597. "password": "",
  4598. "host": "xn--n3h",
  4599. "hostname": "xn--n3h",
  4600. "port": "",
  4601. "pathname": "/",
  4602. "search": "",
  4603. "hash": ""
  4604. },
  4605. {
  4606. "input": "https://%e2%98%83",
  4607. "base": "about:blank",
  4608. "href": "https://xn--n3h/",
  4609. "origin": "https://xn--n3h",
  4610. "protocol": "https:",
  4611. "username": "",
  4612. "password": "",
  4613. "host": "xn--n3h",
  4614. "hostname": "xn--n3h",
  4615. "port": "",
  4616. "pathname": "/",
  4617. "search": "",
  4618. "hash": ""
  4619. },
  4620. "# tests from jsdom/whatwg-url designed for code coverage",
  4621. {
  4622. "input": "http://127.0.0.1:10100/relative_import.html",
  4623. "base": "about:blank",
  4624. "href": "http://127.0.0.1:10100/relative_import.html",
  4625. "origin": "http://127.0.0.1:10100",
  4626. "protocol": "http:",
  4627. "username": "",
  4628. "password": "",
  4629. "host": "127.0.0.1:10100",
  4630. "hostname": "127.0.0.1",
  4631. "port": "10100",
  4632. "pathname": "/relative_import.html",
  4633. "search": "",
  4634. "hash": ""
  4635. },
  4636. {
  4637. "input": "http://facebook.com/?foo=%7B%22abc%22",
  4638. "base": "about:blank",
  4639. "href": "http://facebook.com/?foo=%7B%22abc%22",
  4640. "origin": "http://facebook.com",
  4641. "protocol": "http:",
  4642. "username": "",
  4643. "password": "",
  4644. "host": "facebook.com",
  4645. "hostname": "facebook.com",
  4646. "port": "",
  4647. "pathname": "/",
  4648. "search": "?foo=%7B%22abc%22",
  4649. "hash": ""
  4650. },
  4651. {
  4652. "input": "https://localhost:3000/jqueryui@1.2.3",
  4653. "base": "about:blank",
  4654. "href": "https://localhost:3000/jqueryui@1.2.3",
  4655. "origin": "https://localhost:3000",
  4656. "protocol": "https:",
  4657. "username": "",
  4658. "password": "",
  4659. "host": "localhost:3000",
  4660. "hostname": "localhost",
  4661. "port": "3000",
  4662. "pathname": "/jqueryui@1.2.3",
  4663. "search": "",
  4664. "hash": ""
  4665. },
  4666. "# tab/LF/CR",
  4667. {
  4668. "input": "h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg",
  4669. "base": "about:blank",
  4670. "href": "http://host:9000/path?query#frag",
  4671. "origin": "http://host:9000",
  4672. "protocol": "http:",
  4673. "username": "",
  4674. "password": "",
  4675. "host": "host:9000",
  4676. "hostname": "host",
  4677. "port": "9000",
  4678. "pathname": "/path",
  4679. "search": "?query",
  4680. "hash": "#frag"
  4681. },
  4682. "# Stringification of URL.searchParams",
  4683. {
  4684. "input": "?a=b&c=d",
  4685. "base": "http://example.org/foo/bar",
  4686. "href": "http://example.org/foo/bar?a=b&c=d",
  4687. "origin": "http://example.org",
  4688. "protocol": "http:",
  4689. "username": "",
  4690. "password": "",
  4691. "host": "example.org",
  4692. "hostname": "example.org",
  4693. "port": "",
  4694. "pathname": "/foo/bar",
  4695. "search": "?a=b&c=d",
  4696. "searchParams": "a=b&c=d",
  4697. "hash": ""
  4698. },
  4699. {
  4700. "input": "??a=b&c=d",
  4701. "base": "http://example.org/foo/bar",
  4702. "href": "http://example.org/foo/bar??a=b&c=d",
  4703. "origin": "http://example.org",
  4704. "protocol": "http:",
  4705. "username": "",
  4706. "password": "",
  4707. "host": "example.org",
  4708. "hostname": "example.org",
  4709. "port": "",
  4710. "pathname": "/foo/bar",
  4711. "search": "??a=b&c=d",
  4712. "searchParams": "%3Fa=b&c=d",
  4713. "hash": ""
  4714. },
  4715. "# Scheme only",
  4716. {
  4717. "input": "http:",
  4718. "base": "http://example.org/foo/bar",
  4719. "href": "http://example.org/foo/bar",
  4720. "origin": "http://example.org",
  4721. "protocol": "http:",
  4722. "username": "",
  4723. "password": "",
  4724. "host": "example.org",
  4725. "hostname": "example.org",
  4726. "port": "",
  4727. "pathname": "/foo/bar",
  4728. "search": "",
  4729. "searchParams": "",
  4730. "hash": ""
  4731. },
  4732. {
  4733. "input": "http:",
  4734. "base": "https://example.org/foo/bar",
  4735. "failure": true
  4736. },
  4737. {
  4738. "input": "sc:",
  4739. "base": "https://example.org/foo/bar",
  4740. "href": "sc:",
  4741. "origin": "null",
  4742. "protocol": "sc:",
  4743. "username": "",
  4744. "password": "",
  4745. "host": "",
  4746. "hostname": "",
  4747. "port": "",
  4748. "pathname": "",
  4749. "search": "",
  4750. "searchParams": "",
  4751. "hash": ""
  4752. },
  4753. "# Percent encoding of fragments",
  4754. {
  4755. "input": "http://foo.bar/baz?qux#foo\bbar",
  4756. "base": "about:blank",
  4757. "href": "http://foo.bar/baz?qux#foo%08bar",
  4758. "origin": "http://foo.bar",
  4759. "protocol": "http:",
  4760. "username": "",
  4761. "password": "",
  4762. "host": "foo.bar",
  4763. "hostname": "foo.bar",
  4764. "port": "",
  4765. "pathname": "/baz",
  4766. "search": "?qux",
  4767. "searchParams": "qux=",
  4768. "hash": "#foo%08bar"
  4769. },
  4770. "# IPv4 parsing (via https://github.com/nodejs/node/pull/10317)",
  4771. {
  4772. "input": "http://192.168.257",
  4773. "base": "http://other.com/",
  4774. "href": "http://192.168.1.1/",
  4775. "origin": "http://192.168.1.1",
  4776. "protocol": "http:",
  4777. "username": "",
  4778. "password": "",
  4779. "host": "192.168.1.1",
  4780. "hostname": "192.168.1.1",
  4781. "port": "",
  4782. "pathname": "/",
  4783. "search": "",
  4784. "hash": ""
  4785. },
  4786. {
  4787. "input": "http://192.168.257.com",
  4788. "base": "http://other.com/",
  4789. "href": "http://192.168.257.com/",
  4790. "origin": "http://192.168.257.com",
  4791. "protocol": "http:",
  4792. "username": "",
  4793. "password": "",
  4794. "host": "192.168.257.com",
  4795. "hostname": "192.168.257.com",
  4796. "port": "",
  4797. "pathname": "/",
  4798. "search": "",
  4799. "hash": ""
  4800. },
  4801. {
  4802. "input": "http://256",
  4803. "base": "http://other.com/",
  4804. "href": "http://0.0.1.0/",
  4805. "origin": "http://0.0.1.0",
  4806. "protocol": "http:",
  4807. "username": "",
  4808. "password": "",
  4809. "host": "0.0.1.0",
  4810. "hostname": "0.0.1.0",
  4811. "port": "",
  4812. "pathname": "/",
  4813. "search": "",
  4814. "hash": ""
  4815. },
  4816. {
  4817. "input": "http://256.com",
  4818. "base": "http://other.com/",
  4819. "href": "http://256.com/",
  4820. "origin": "http://256.com",
  4821. "protocol": "http:",
  4822. "username": "",
  4823. "password": "",
  4824. "host": "256.com",
  4825. "hostname": "256.com",
  4826. "port": "",
  4827. "pathname": "/",
  4828. "search": "",
  4829. "hash": ""
  4830. },
  4831. {
  4832. "input": "http://999999999",
  4833. "base": "http://other.com/",
  4834. "href": "http://59.154.201.255/",
  4835. "origin": "http://59.154.201.255",
  4836. "protocol": "http:",
  4837. "username": "",
  4838. "password": "",
  4839. "host": "59.154.201.255",
  4840. "hostname": "59.154.201.255",
  4841. "port": "",
  4842. "pathname": "/",
  4843. "search": "",
  4844. "hash": ""
  4845. },
  4846. {
  4847. "input": "http://999999999.com",
  4848. "base": "http://other.com/",
  4849. "href": "http://999999999.com/",
  4850. "origin": "http://999999999.com",
  4851. "protocol": "http:",
  4852. "username": "",
  4853. "password": "",
  4854. "host": "999999999.com",
  4855. "hostname": "999999999.com",
  4856. "port": "",
  4857. "pathname": "/",
  4858. "search": "",
  4859. "hash": ""
  4860. },
  4861. {
  4862. "input": "http://10000000000",
  4863. "base": "http://other.com/",
  4864. "failure": true
  4865. },
  4866. {
  4867. "input": "http://10000000000.com",
  4868. "base": "http://other.com/",
  4869. "href": "http://10000000000.com/",
  4870. "origin": "http://10000000000.com",
  4871. "protocol": "http:",
  4872. "username": "",
  4873. "password": "",
  4874. "host": "10000000000.com",
  4875. "hostname": "10000000000.com",
  4876. "port": "",
  4877. "pathname": "/",
  4878. "search": "",
  4879. "hash": ""
  4880. },
  4881. {
  4882. "input": "http://4294967295",
  4883. "base": "http://other.com/",
  4884. "href": "http://255.255.255.255/",
  4885. "origin": "http://255.255.255.255",
  4886. "protocol": "http:",
  4887. "username": "",
  4888. "password": "",
  4889. "host": "255.255.255.255",
  4890. "hostname": "255.255.255.255",
  4891. "port": "",
  4892. "pathname": "/",
  4893. "search": "",
  4894. "hash": ""
  4895. },
  4896. {
  4897. "input": "http://4294967296",
  4898. "base": "http://other.com/",
  4899. "failure": true
  4900. },
  4901. {
  4902. "input": "http://0xffffffff",
  4903. "base": "http://other.com/",
  4904. "href": "http://255.255.255.255/",
  4905. "origin": "http://255.255.255.255",
  4906. "protocol": "http:",
  4907. "username": "",
  4908. "password": "",
  4909. "host": "255.255.255.255",
  4910. "hostname": "255.255.255.255",
  4911. "port": "",
  4912. "pathname": "/",
  4913. "search": "",
  4914. "hash": ""
  4915. },
  4916. {
  4917. "input": "http://0xffffffff1",
  4918. "base": "http://other.com/",
  4919. "failure": true
  4920. },
  4921. {
  4922. "input": "http://256.256.256.256",
  4923. "base": "http://other.com/",
  4924. "failure": true
  4925. },
  4926. {
  4927. "input": "http://256.256.256.256.256",
  4928. "base": "http://other.com/",
  4929. "href": "http://256.256.256.256.256/",
  4930. "origin": "http://256.256.256.256.256",
  4931. "protocol": "http:",
  4932. "username": "",
  4933. "password": "",
  4934. "host": "256.256.256.256.256",
  4935. "hostname": "256.256.256.256.256",
  4936. "port": "",
  4937. "pathname": "/",
  4938. "search": "",
  4939. "hash": ""
  4940. },
  4941. {
  4942. "input": "https://0x.0x.0",
  4943. "base": "about:blank",
  4944. "href": "https://0.0.0.0/",
  4945. "origin": "https://0.0.0.0",
  4946. "protocol": "https:",
  4947. "username": "",
  4948. "password": "",
  4949. "host": "0.0.0.0",
  4950. "hostname": "0.0.0.0",
  4951. "port": "",
  4952. "pathname": "/",
  4953. "search": "",
  4954. "hash": ""
  4955. },
  4956. "More IPv4 parsing (via https://github.com/jsdom/whatwg-url/issues/92)",
  4957. {
  4958. "input": "https://256.0.0.1/test",
  4959. "base": "about:blank",
  4960. "failure": true
  4961. },
  4962. "# file URLs containing percent-encoded Windows drive letters (shouldn't work)",
  4963. {
  4964. "input": "file:///C%3A/",
  4965. "base": "about:blank",
  4966. "href": "file:///C%3A/",
  4967. "protocol": "file:",
  4968. "username": "",
  4969. "password": "",
  4970. "host": "",
  4971. "hostname": "",
  4972. "port": "",
  4973. "pathname": "/C%3A/",
  4974. "search": "",
  4975. "hash": ""
  4976. },
  4977. {
  4978. "input": "file:///C%7C/",
  4979. "base": "about:blank",
  4980. "href": "file:///C%7C/",
  4981. "protocol": "file:",
  4982. "username": "",
  4983. "password": "",
  4984. "host": "",
  4985. "hostname": "",
  4986. "port": "",
  4987. "pathname": "/C%7C/",
  4988. "search": "",
  4989. "hash": ""
  4990. },
  4991. "# file URLs relative to other file URLs (via https://github.com/jsdom/whatwg-url/pull/60)",
  4992. {
  4993. "input": "pix/submit.gif",
  4994. "base": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html",
  4995. "href": "file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
  4996. "protocol": "file:",
  4997. "username": "",
  4998. "password": "",
  4999. "host": "",
  5000. "hostname": "",
  5001. "port": "",
  5002. "pathname": "/C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/pix/submit.gif",
  5003. "search": "",
  5004. "hash": ""
  5005. },
  5006. {
  5007. "input": "..",
  5008. "base": "file:///C:/",
  5009. "href": "file:///C:/",
  5010. "protocol": "file:",
  5011. "username": "",
  5012. "password": "",
  5013. "host": "",
  5014. "hostname": "",
  5015. "port": "",
  5016. "pathname": "/C:/",
  5017. "search": "",
  5018. "hash": ""
  5019. },
  5020. {
  5021. "input": "..",
  5022. "base": "file:///",
  5023. "href": "file:///",
  5024. "protocol": "file:",
  5025. "username": "",
  5026. "password": "",
  5027. "host": "",
  5028. "hostname": "",
  5029. "port": "",
  5030. "pathname": "/",
  5031. "search": "",
  5032. "hash": ""
  5033. },
  5034. "# More file URL tests by zcorpan and annevk",
  5035. {
  5036. "input": "/",
  5037. "base": "file:///C:/a/b",
  5038. "href": "file:///C:/",
  5039. "protocol": "file:",
  5040. "username": "",
  5041. "password": "",
  5042. "host": "",
  5043. "hostname": "",
  5044. "port": "",
  5045. "pathname": "/C:/",
  5046. "search": "",
  5047. "hash": ""
  5048. },
  5049. {
  5050. "input": "//d:",
  5051. "base": "file:///C:/a/b",
  5052. "href": "file:///d:",
  5053. "protocol": "file:",
  5054. "username": "",
  5055. "password": "",
  5056. "host": "",
  5057. "hostname": "",
  5058. "port": "",
  5059. "pathname": "/d:",
  5060. "search": "",
  5061. "hash": ""
  5062. },
  5063. {
  5064. "input": "//d:/..",
  5065. "base": "file:///C:/a/b",
  5066. "href": "file:///d:/",
  5067. "protocol": "file:",
  5068. "username": "",
  5069. "password": "",
  5070. "host": "",
  5071. "hostname": "",
  5072. "port": "",
  5073. "pathname": "/d:/",
  5074. "search": "",
  5075. "hash": ""
  5076. },
  5077. {
  5078. "input": "..",
  5079. "base": "file:///ab:/",
  5080. "href": "file:///",
  5081. "protocol": "file:",
  5082. "username": "",
  5083. "password": "",
  5084. "host": "",
  5085. "hostname": "",
  5086. "port": "",
  5087. "pathname": "/",
  5088. "search": "",
  5089. "hash": ""
  5090. },
  5091. {
  5092. "input": "..",
  5093. "base": "file:///1:/",
  5094. "href": "file:///",
  5095. "protocol": "file:",
  5096. "username": "",
  5097. "password": "",
  5098. "host": "",
  5099. "hostname": "",
  5100. "port": "",
  5101. "pathname": "/",
  5102. "search": "",
  5103. "hash": ""
  5104. },
  5105. {
  5106. "input": "",
  5107. "base": "file:///test?test#test",
  5108. "href": "file:///test?test",
  5109. "protocol": "file:",
  5110. "username": "",
  5111. "password": "",
  5112. "host": "",
  5113. "hostname": "",
  5114. "port": "",
  5115. "pathname": "/test",
  5116. "search": "?test",
  5117. "hash": ""
  5118. },
  5119. {
  5120. "input": "file:",
  5121. "base": "file:///test?test#test",
  5122. "href": "file:///test?test",
  5123. "protocol": "file:",
  5124. "username": "",
  5125. "password": "",
  5126. "host": "",
  5127. "hostname": "",
  5128. "port": "",
  5129. "pathname": "/test",
  5130. "search": "?test",
  5131. "hash": ""
  5132. },
  5133. {
  5134. "input": "?x",
  5135. "base": "file:///test?test#test",
  5136. "href": "file:///test?x",
  5137. "protocol": "file:",
  5138. "username": "",
  5139. "password": "",
  5140. "host": "",
  5141. "hostname": "",
  5142. "port": "",
  5143. "pathname": "/test",
  5144. "search": "?x",
  5145. "hash": ""
  5146. },
  5147. {
  5148. "input": "file:?x",
  5149. "base": "file:///test?test#test",
  5150. "href": "file:///test?x",
  5151. "protocol": "file:",
  5152. "username": "",
  5153. "password": "",
  5154. "host": "",
  5155. "hostname": "",
  5156. "port": "",
  5157. "pathname": "/test",
  5158. "search": "?x",
  5159. "hash": ""
  5160. },
  5161. {
  5162. "input": "#x",
  5163. "base": "file:///test?test#test",
  5164. "href": "file:///test?test#x",
  5165. "protocol": "file:",
  5166. "username": "",
  5167. "password": "",
  5168. "host": "",
  5169. "hostname": "",
  5170. "port": "",
  5171. "pathname": "/test",
  5172. "search": "?test",
  5173. "hash": "#x"
  5174. },
  5175. {
  5176. "input": "file:#x",
  5177. "base": "file:///test?test#test",
  5178. "href": "file:///test?test#x",
  5179. "protocol": "file:",
  5180. "username": "",
  5181. "password": "",
  5182. "host": "",
  5183. "hostname": "",
  5184. "port": "",
  5185. "pathname": "/test",
  5186. "search": "?test",
  5187. "hash": "#x"
  5188. },
  5189. "# File URLs and many (back)slashes",
  5190. {
  5191. "input": "file:///localhost//cat",
  5192. "base": "about:blank",
  5193. "href": "file:///localhost//cat",
  5194. "protocol": "file:",
  5195. "username": "",
  5196. "password": "",
  5197. "host": "",
  5198. "hostname": "",
  5199. "port": "",
  5200. "pathname": "/localhost//cat",
  5201. "search": "",
  5202. "hash": ""
  5203. },
  5204. {
  5205. "input": "\\//pig",
  5206. "base": "file://lion/",
  5207. "href": "file:///pig",
  5208. "protocol": "file:",
  5209. "username": "",
  5210. "password": "",
  5211. "host": "",
  5212. "hostname": "",
  5213. "port": "",
  5214. "pathname": "/pig",
  5215. "search": "",
  5216. "hash": ""
  5217. },
  5218. {
  5219. "input": "file://",
  5220. "base": "file://ape/",
  5221. "href": "file:///",
  5222. "protocol": "file:",
  5223. "username": "",
  5224. "password": "",
  5225. "host": "",
  5226. "hostname": "",
  5227. "port": "",
  5228. "pathname": "/",
  5229. "search": "",
  5230. "hash": ""
  5231. },
  5232. "# Windows drive letter handling with the 'file:' base URL",
  5233. {
  5234. "input": "C|#",
  5235. "base": "file://host/dir/file",
  5236. "href": "file:///C:#",
  5237. "protocol": "file:",
  5238. "username": "",
  5239. "password": "",
  5240. "host": "",
  5241. "hostname": "",
  5242. "port": "",
  5243. "pathname": "/C:",
  5244. "search": "",
  5245. "hash": ""
  5246. },
  5247. {
  5248. "input": "C|?",
  5249. "base": "file://host/dir/file",
  5250. "href": "file:///C:?",
  5251. "protocol": "file:",
  5252. "username": "",
  5253. "password": "",
  5254. "host": "",
  5255. "hostname": "",
  5256. "port": "",
  5257. "pathname": "/C:",
  5258. "search": "",
  5259. "hash": ""
  5260. },
  5261. {
  5262. "input": "C|/",
  5263. "base": "file://host/dir/file",
  5264. "href": "file:///C:/",
  5265. "protocol": "file:",
  5266. "username": "",
  5267. "password": "",
  5268. "host": "",
  5269. "hostname": "",
  5270. "port": "",
  5271. "pathname": "/C:/",
  5272. "search": "",
  5273. "hash": ""
  5274. },
  5275. {
  5276. "input": "C|\n/",
  5277. "base": "file://host/dir/file",
  5278. "href": "file:///C:/",
  5279. "protocol": "file:",
  5280. "username": "",
  5281. "password": "",
  5282. "host": "",
  5283. "hostname": "",
  5284. "port": "",
  5285. "pathname": "/C:/",
  5286. "search": "",
  5287. "hash": ""
  5288. },
  5289. {
  5290. "input": "C|\\",
  5291. "base": "file://host/dir/file",
  5292. "href": "file:///C:/",
  5293. "protocol": "file:",
  5294. "username": "",
  5295. "password": "",
  5296. "host": "",
  5297. "hostname": "",
  5298. "port": "",
  5299. "pathname": "/C:/",
  5300. "search": "",
  5301. "hash": ""
  5302. },
  5303. {
  5304. "input": "C",
  5305. "base": "file://host/dir/file",
  5306. "href": "file://host/dir/C",
  5307. "protocol": "file:",
  5308. "username": "",
  5309. "password": "",
  5310. "host": "host",
  5311. "hostname": "host",
  5312. "port": "",
  5313. "pathname": "/dir/C",
  5314. "search": "",
  5315. "hash": ""
  5316. },
  5317. {
  5318. "input": "C|a",
  5319. "base": "file://host/dir/file",
  5320. "href": "file://host/dir/C|a",
  5321. "protocol": "file:",
  5322. "username": "",
  5323. "password": "",
  5324. "host": "host",
  5325. "hostname": "host",
  5326. "port": "",
  5327. "pathname": "/dir/C|a",
  5328. "search": "",
  5329. "hash": ""
  5330. },
  5331. "# Windows drive letter quirk in the file slash state",
  5332. {
  5333. "input": "/c:/foo/bar",
  5334. "base": "file://host/path",
  5335. "href": "file:///c:/foo/bar",
  5336. "protocol": "file:",
  5337. "username": "",
  5338. "password": "",
  5339. "host": "",
  5340. "hostname": "",
  5341. "port": "",
  5342. "pathname": "/c:/foo/bar",
  5343. "search": "",
  5344. "hash": ""
  5345. },
  5346. "# Windows drive letter quirk (no host)",
  5347. {
  5348. "input": "file:/C|/",
  5349. "base": "about:blank",
  5350. "href": "file:///C:/",
  5351. "protocol": "file:",
  5352. "username": "",
  5353. "password": "",
  5354. "host": "",
  5355. "hostname": "",
  5356. "port": "",
  5357. "pathname": "/C:/",
  5358. "search": "",
  5359. "hash": ""
  5360. },
  5361. {
  5362. "input": "file://C|/",
  5363. "base": "about:blank",
  5364. "href": "file:///C:/",
  5365. "protocol": "file:",
  5366. "username": "",
  5367. "password": "",
  5368. "host": "",
  5369. "hostname": "",
  5370. "port": "",
  5371. "pathname": "/C:/",
  5372. "search": "",
  5373. "hash": ""
  5374. },
  5375. "# Windows drive letter quirk with not empty host",
  5376. {
  5377. "input": "file://example.net/C:/",
  5378. "base": "about:blank",
  5379. "href": "file:///C:/",
  5380. "protocol": "file:",
  5381. "username": "",
  5382. "password": "",
  5383. "host": "",
  5384. "hostname": "",
  5385. "port": "",
  5386. "pathname": "/C:/",
  5387. "search": "",
  5388. "hash": ""
  5389. },
  5390. {
  5391. "input": "file://1.2.3.4/C:/",
  5392. "base": "about:blank",
  5393. "href": "file:///C:/",
  5394. "protocol": "file:",
  5395. "username": "",
  5396. "password": "",
  5397. "host": "",
  5398. "hostname": "",
  5399. "port": "",
  5400. "pathname": "/C:/",
  5401. "search": "",
  5402. "hash": ""
  5403. },
  5404. {
  5405. "input": "file://[1::8]/C:/",
  5406. "base": "about:blank",
  5407. "href": "file:///C:/",
  5408. "protocol": "file:",
  5409. "username": "",
  5410. "password": "",
  5411. "host": "",
  5412. "hostname": "",
  5413. "port": "",
  5414. "pathname": "/C:/",
  5415. "search": "",
  5416. "hash": ""
  5417. },
  5418. "# file URLs without base URL by Rimas Misevičius",
  5419. {
  5420. "input": "file:",
  5421. "base": "about:blank",
  5422. "href": "file:///",
  5423. "protocol": "file:",
  5424. "username": "",
  5425. "password": "",
  5426. "host": "",
  5427. "hostname": "",
  5428. "port": "",
  5429. "pathname": "/",
  5430. "search": "",
  5431. "hash": ""
  5432. },
  5433. {
  5434. "input": "file:?q=v",
  5435. "base": "about:blank",
  5436. "href": "file:///?q=v",
  5437. "protocol": "file:",
  5438. "username": "",
  5439. "password": "",
  5440. "host": "",
  5441. "hostname": "",
  5442. "port": "",
  5443. "pathname": "/",
  5444. "search": "?q=v",
  5445. "hash": ""
  5446. },
  5447. {
  5448. "input": "file:#frag",
  5449. "base": "about:blank",
  5450. "href": "file:///#frag",
  5451. "protocol": "file:",
  5452. "username": "",
  5453. "password": "",
  5454. "host": "",
  5455. "hostname": "",
  5456. "port": "",
  5457. "pathname": "/",
  5458. "search": "",
  5459. "hash": "#frag"
  5460. },
  5461. "# IPv6 tests",
  5462. {
  5463. "input": "http://[1:0::]",
  5464. "base": "http://example.net/",
  5465. "href": "http://[1::]/",
  5466. "origin": "http://[1::]",
  5467. "protocol": "http:",
  5468. "username": "",
  5469. "password": "",
  5470. "host": "[1::]",
  5471. "hostname": "[1::]",
  5472. "port": "",
  5473. "pathname": "/",
  5474. "search": "",
  5475. "hash": ""
  5476. },
  5477. {
  5478. "input": "http://[0:1:2:3:4:5:6:7:8]",
  5479. "base": "http://example.net/",
  5480. "failure": true
  5481. },
  5482. {
  5483. "input": "https://[0::0::0]",
  5484. "base": "about:blank",
  5485. "failure": true
  5486. },
  5487. {
  5488. "input": "https://[0:.0]",
  5489. "base": "about:blank",
  5490. "failure": true
  5491. },
  5492. {
  5493. "input": "https://[0:0:]",
  5494. "base": "about:blank",
  5495. "failure": true
  5496. },
  5497. {
  5498. "input": "https://[0:1:2:3:4:5:6:7.0.0.0.1]",
  5499. "base": "about:blank",
  5500. "failure": true
  5501. },
  5502. {
  5503. "input": "https://[0:1.00.0.0.0]",
  5504. "base": "about:blank",
  5505. "failure": true
  5506. },
  5507. {
  5508. "input": "https://[0:1.290.0.0.0]",
  5509. "base": "about:blank",
  5510. "failure": true
  5511. },
  5512. {
  5513. "input": "https://[0:1.23.23]",
  5514. "base": "about:blank",
  5515. "failure": true
  5516. },
  5517. "# Empty host",
  5518. {
  5519. "input": "http://?",
  5520. "base": "about:blank",
  5521. "failure": true
  5522. },
  5523. {
  5524. "input": "http://#",
  5525. "base": "about:blank",
  5526. "failure": true
  5527. },
  5528. "Port overflow (2^32 + 81)",
  5529. {
  5530. "input": "http://f:4294967377/c",
  5531. "base": "http://example.org/",
  5532. "failure": true
  5533. },
  5534. "Port overflow (2^64 + 81)",
  5535. {
  5536. "input": "http://f:18446744073709551697/c",
  5537. "base": "http://example.org/",
  5538. "failure": true
  5539. },
  5540. "Port overflow (2^128 + 81)",
  5541. {
  5542. "input": "http://f:340282366920938463463374607431768211537/c",
  5543. "base": "http://example.org/",
  5544. "failure": true
  5545. },
  5546. "# Non-special-URL path tests",
  5547. {
  5548. "input": "///",
  5549. "base": "sc://x/",
  5550. "href": "sc:///",
  5551. "protocol": "sc:",
  5552. "username": "",
  5553. "password": "",
  5554. "host": "",
  5555. "hostname": "",
  5556. "port": "",
  5557. "pathname": "/",
  5558. "search": "",
  5559. "hash": ""
  5560. },
  5561. {
  5562. "input": "tftp://foobar.com/someconfig;mode=netascii",
  5563. "base": "about:blank",
  5564. "href": "tftp://foobar.com/someconfig;mode=netascii",
  5565. "origin": "null",
  5566. "protocol": "tftp:",
  5567. "username": "",
  5568. "password": "",
  5569. "host": "foobar.com",
  5570. "hostname": "foobar.com",
  5571. "port": "",
  5572. "pathname": "/someconfig;mode=netascii",
  5573. "search": "",
  5574. "hash": ""
  5575. },
  5576. {
  5577. "input": "telnet://user:pass@foobar.com:23/",
  5578. "base": "about:blank",
  5579. "href": "telnet://user:pass@foobar.com:23/",
  5580. "origin": "null",
  5581. "protocol": "telnet:",
  5582. "username": "user",
  5583. "password": "pass",
  5584. "host": "foobar.com:23",
  5585. "hostname": "foobar.com",
  5586. "port": "23",
  5587. "pathname": "/",
  5588. "search": "",
  5589. "hash": ""
  5590. },
  5591. {
  5592. "input": "ut2004://10.10.10.10:7777/Index.ut2",
  5593. "base": "about:blank",
  5594. "href": "ut2004://10.10.10.10:7777/Index.ut2",
  5595. "origin": "null",
  5596. "protocol": "ut2004:",
  5597. "username": "",
  5598. "password": "",
  5599. "host": "10.10.10.10:7777",
  5600. "hostname": "10.10.10.10",
  5601. "port": "7777",
  5602. "pathname": "/Index.ut2",
  5603. "search": "",
  5604. "hash": ""
  5605. },
  5606. {
  5607. "input": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
  5608. "base": "about:blank",
  5609. "href": "redis://foo:bar@somehost:6379/0?baz=bam&qux=baz",
  5610. "origin": "null",
  5611. "protocol": "redis:",
  5612. "username": "foo",
  5613. "password": "bar",
  5614. "host": "somehost:6379",
  5615. "hostname": "somehost",
  5616. "port": "6379",
  5617. "pathname": "/0",
  5618. "search": "?baz=bam&qux=baz",
  5619. "hash": ""
  5620. },
  5621. {
  5622. "input": "rsync://foo@host:911/sup",
  5623. "base": "about:blank",
  5624. "href": "rsync://foo@host:911/sup",
  5625. "origin": "null",
  5626. "protocol": "rsync:",
  5627. "username": "foo",
  5628. "password": "",
  5629. "host": "host:911",
  5630. "hostname": "host",
  5631. "port": "911",
  5632. "pathname": "/sup",
  5633. "search": "",
  5634. "hash": ""
  5635. },
  5636. {
  5637. "input": "git://github.com/foo/bar.git",
  5638. "base": "about:blank",
  5639. "href": "git://github.com/foo/bar.git",
  5640. "origin": "null",
  5641. "protocol": "git:",
  5642. "username": "",
  5643. "password": "",
  5644. "host": "github.com",
  5645. "hostname": "github.com",
  5646. "port": "",
  5647. "pathname": "/foo/bar.git",
  5648. "search": "",
  5649. "hash": ""
  5650. },
  5651. {
  5652. "input": "irc://myserver.com:6999/channel?passwd",
  5653. "base": "about:blank",
  5654. "href": "irc://myserver.com:6999/channel?passwd",
  5655. "origin": "null",
  5656. "protocol": "irc:",
  5657. "username": "",
  5658. "password": "",
  5659. "host": "myserver.com:6999",
  5660. "hostname": "myserver.com",
  5661. "port": "6999",
  5662. "pathname": "/channel",
  5663. "search": "?passwd",
  5664. "hash": ""
  5665. },
  5666. {
  5667. "input": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
  5668. "base": "about:blank",
  5669. "href": "dns://fw.example.org:9999/foo.bar.org?type=TXT",
  5670. "origin": "null",
  5671. "protocol": "dns:",
  5672. "username": "",
  5673. "password": "",
  5674. "host": "fw.example.org:9999",
  5675. "hostname": "fw.example.org",
  5676. "port": "9999",
  5677. "pathname": "/foo.bar.org",
  5678. "search": "?type=TXT",
  5679. "hash": ""
  5680. },
  5681. {
  5682. "input": "ldap://localhost:389/ou=People,o=JNDITutorial",
  5683. "base": "about:blank",
  5684. "href": "ldap://localhost:389/ou=People,o=JNDITutorial",
  5685. "origin": "null",
  5686. "protocol": "ldap:",
  5687. "username": "",
  5688. "password": "",
  5689. "host": "localhost:389",
  5690. "hostname": "localhost",
  5691. "port": "389",
  5692. "pathname": "/ou=People,o=JNDITutorial",
  5693. "search": "",
  5694. "hash": ""
  5695. },
  5696. {
  5697. "input": "git+https://github.com/foo/bar",
  5698. "base": "about:blank",
  5699. "href": "git+https://github.com/foo/bar",
  5700. "origin": "null",
  5701. "protocol": "git+https:",
  5702. "username": "",
  5703. "password": "",
  5704. "host": "github.com",
  5705. "hostname": "github.com",
  5706. "port": "",
  5707. "pathname": "/foo/bar",
  5708. "search": "",
  5709. "hash": ""
  5710. },
  5711. {
  5712. "input": "urn:ietf:rfc:2648",
  5713. "base": "about:blank",
  5714. "href": "urn:ietf:rfc:2648",
  5715. "origin": "null",
  5716. "protocol": "urn:",
  5717. "username": "",
  5718. "password": "",
  5719. "host": "",
  5720. "hostname": "",
  5721. "port": "",
  5722. "pathname": "ietf:rfc:2648",
  5723. "search": "",
  5724. "hash": ""
  5725. },
  5726. {
  5727. "input": "tag:joe@example.org,2001:foo/bar",
  5728. "base": "about:blank",
  5729. "href": "tag:joe@example.org,2001:foo/bar",
  5730. "origin": "null",
  5731. "protocol": "tag:",
  5732. "username": "",
  5733. "password": "",
  5734. "host": "",
  5735. "hostname": "",
  5736. "port": "",
  5737. "pathname": "joe@example.org,2001:foo/bar",
  5738. "search": "",
  5739. "hash": ""
  5740. },
  5741. "# percent encoded hosts in non-special-URLs",
  5742. {
  5743. "input": "non-special://%E2%80%A0/",
  5744. "base": "about:blank",
  5745. "href": "non-special://%E2%80%A0/",
  5746. "protocol": "non-special:",
  5747. "username": "",
  5748. "password": "",
  5749. "host": "%E2%80%A0",
  5750. "hostname": "%E2%80%A0",
  5751. "port": "",
  5752. "pathname": "/",
  5753. "search": "",
  5754. "hash": ""
  5755. },
  5756. {
  5757. "input": "non-special://H%4fSt/path",
  5758. "base": "about:blank",
  5759. "href": "non-special://H%4fSt/path",
  5760. "protocol": "non-special:",
  5761. "username": "",
  5762. "password": "",
  5763. "host": "H%4fSt",
  5764. "hostname": "H%4fSt",
  5765. "port": "",
  5766. "pathname": "/path",
  5767. "search": "",
  5768. "hash": ""
  5769. },
  5770. "# IPv6 in non-special-URLs",
  5771. {
  5772. "input": "non-special://[1:2:0:0:5:0:0:0]/",
  5773. "base": "about:blank",
  5774. "href": "non-special://[1:2:0:0:5::]/",
  5775. "protocol": "non-special:",
  5776. "username": "",
  5777. "password": "",
  5778. "host": "[1:2:0:0:5::]",
  5779. "hostname": "[1:2:0:0:5::]",
  5780. "port": "",
  5781. "pathname": "/",
  5782. "search": "",
  5783. "hash": ""
  5784. },
  5785. {
  5786. "input": "non-special://[1:2:0:0:0:0:0:3]/",
  5787. "base": "about:blank",
  5788. "href": "non-special://[1:2::3]/",
  5789. "protocol": "non-special:",
  5790. "username": "",
  5791. "password": "",
  5792. "host": "[1:2::3]",
  5793. "hostname": "[1:2::3]",
  5794. "port": "",
  5795. "pathname": "/",
  5796. "search": "",
  5797. "hash": ""
  5798. },
  5799. {
  5800. "input": "non-special://[1:2::3]:80/",
  5801. "base": "about:blank",
  5802. "href": "non-special://[1:2::3]:80/",
  5803. "protocol": "non-special:",
  5804. "username": "",
  5805. "password": "",
  5806. "host": "[1:2::3]:80",
  5807. "hostname": "[1:2::3]",
  5808. "port": "80",
  5809. "pathname": "/",
  5810. "search": "",
  5811. "hash": ""
  5812. },
  5813. {
  5814. "input": "non-special://[:80/",
  5815. "base": "about:blank",
  5816. "failure": true
  5817. },
  5818. {
  5819. "input": "blob:https://example.com:443/",
  5820. "base": "about:blank",
  5821. "href": "blob:https://example.com:443/",
  5822. "protocol": "blob:",
  5823. "username": "",
  5824. "password": "",
  5825. "host": "",
  5826. "hostname": "",
  5827. "port": "",
  5828. "pathname": "https://example.com:443/",
  5829. "search": "",
  5830. "hash": ""
  5831. },
  5832. {
  5833. "input": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
  5834. "base": "about:blank",
  5835. "href": "blob:d3958f5c-0777-0845-9dcf-2cb28783acaf",
  5836. "protocol": "blob:",
  5837. "username": "",
  5838. "password": "",
  5839. "host": "",
  5840. "hostname": "",
  5841. "port": "",
  5842. "pathname": "d3958f5c-0777-0845-9dcf-2cb28783acaf",
  5843. "search": "",
  5844. "hash": ""
  5845. },
  5846. "Invalid IPv4 radix digits",
  5847. {
  5848. "input": "http://0177.0.0.0189",
  5849. "base": "about:blank",
  5850. "href": "http://0177.0.0.0189/",
  5851. "protocol": "http:",
  5852. "username": "",
  5853. "password": "",
  5854. "host": "0177.0.0.0189",
  5855. "hostname": "0177.0.0.0189",
  5856. "port": "",
  5857. "pathname": "/",
  5858. "search": "",
  5859. "hash": ""
  5860. },
  5861. {
  5862. "input": "http://0x7f.0.0.0x7g",
  5863. "base": "about:blank",
  5864. "href": "http://0x7f.0.0.0x7g/",
  5865. "protocol": "http:",
  5866. "username": "",
  5867. "password": "",
  5868. "host": "0x7f.0.0.0x7g",
  5869. "hostname": "0x7f.0.0.0x7g",
  5870. "port": "",
  5871. "pathname": "/",
  5872. "search": "",
  5873. "hash": ""
  5874. },
  5875. {
  5876. "input": "http://0X7F.0.0.0X7G",
  5877. "base": "about:blank",
  5878. "href": "http://0x7f.0.0.0x7g/",
  5879. "protocol": "http:",
  5880. "username": "",
  5881. "password": "",
  5882. "host": "0x7f.0.0.0x7g",
  5883. "hostname": "0x7f.0.0.0x7g",
  5884. "port": "",
  5885. "pathname": "/",
  5886. "search": "",
  5887. "hash": ""
  5888. },
  5889. "Invalid IPv4 portion of IPv6 address",
  5890. {
  5891. "input": "http://[::127.0.0.0.1]",
  5892. "base": "about:blank",
  5893. "failure": true
  5894. },
  5895. "Uncompressed IPv6 addresses with 0",
  5896. {
  5897. "input": "http://[0:1:0:1:0:1:0:1]",
  5898. "base": "about:blank",
  5899. "href": "http://[0:1:0:1:0:1:0:1]/",
  5900. "protocol": "http:",
  5901. "username": "",
  5902. "password": "",
  5903. "host": "[0:1:0:1:0:1:0:1]",
  5904. "hostname": "[0:1:0:1:0:1:0:1]",
  5905. "port": "",
  5906. "pathname": "/",
  5907. "search": "",
  5908. "hash": ""
  5909. },
  5910. {
  5911. "input": "http://[1:0:1:0:1:0:1:0]",
  5912. "base": "about:blank",
  5913. "href": "http://[1:0:1:0:1:0:1:0]/",
  5914. "protocol": "http:",
  5915. "username": "",
  5916. "password": "",
  5917. "host": "[1:0:1:0:1:0:1:0]",
  5918. "hostname": "[1:0:1:0:1:0:1:0]",
  5919. "port": "",
  5920. "pathname": "/",
  5921. "search": "",
  5922. "hash": ""
  5923. },
  5924. "Percent-encoded query and fragment",
  5925. {
  5926. "input": "http://example.org/test?\u0022",
  5927. "base": "about:blank",
  5928. "href": "http://example.org/test?%22",
  5929. "protocol": "http:",
  5930. "username": "",
  5931. "password": "",
  5932. "host": "example.org",
  5933. "hostname": "example.org",
  5934. "port": "",
  5935. "pathname": "/test",
  5936. "search": "?%22",
  5937. "hash": ""
  5938. },
  5939. {
  5940. "input": "http://example.org/test?\u0023",
  5941. "base": "about:blank",
  5942. "href": "http://example.org/test?#",
  5943. "protocol": "http:",
  5944. "username": "",
  5945. "password": "",
  5946. "host": "example.org",
  5947. "hostname": "example.org",
  5948. "port": "",
  5949. "pathname": "/test",
  5950. "search": "",
  5951. "hash": ""
  5952. },
  5953. {
  5954. "input": "http://example.org/test?\u003C",
  5955. "base": "about:blank",
  5956. "href": "http://example.org/test?%3C",
  5957. "protocol": "http:",
  5958. "username": "",
  5959. "password": "",
  5960. "host": "example.org",
  5961. "hostname": "example.org",
  5962. "port": "",
  5963. "pathname": "/test",
  5964. "search": "?%3C",
  5965. "hash": ""
  5966. },
  5967. {
  5968. "input": "http://example.org/test?\u003E",
  5969. "base": "about:blank",
  5970. "href": "http://example.org/test?%3E",
  5971. "protocol": "http:",
  5972. "username": "",
  5973. "password": "",
  5974. "host": "example.org",
  5975. "hostname": "example.org",
  5976. "port": "",
  5977. "pathname": "/test",
  5978. "search": "?%3E",
  5979. "hash": ""
  5980. },
  5981. {
  5982. "input": "http://example.org/test?\u2323",
  5983. "base": "about:blank",
  5984. "href": "http://example.org/test?%E2%8C%A3",
  5985. "protocol": "http:",
  5986. "username": "",
  5987. "password": "",
  5988. "host": "example.org",
  5989. "hostname": "example.org",
  5990. "port": "",
  5991. "pathname": "/test",
  5992. "search": "?%E2%8C%A3",
  5993. "hash": ""
  5994. },
  5995. {
  5996. "input": "http://example.org/test?%23%23",
  5997. "base": "about:blank",
  5998. "href": "http://example.org/test?%23%23",
  5999. "protocol": "http:",
  6000. "username": "",
  6001. "password": "",
  6002. "host": "example.org",
  6003. "hostname": "example.org",
  6004. "port": "",
  6005. "pathname": "/test",
  6006. "search": "?%23%23",
  6007. "hash": ""
  6008. },
  6009. {
  6010. "input": "http://example.org/test?%GH",
  6011. "base": "about:blank",
  6012. "href": "http://example.org/test?%GH",
  6013. "protocol": "http:",
  6014. "username": "",
  6015. "password": "",
  6016. "host": "example.org",
  6017. "hostname": "example.org",
  6018. "port": "",
  6019. "pathname": "/test",
  6020. "search": "?%GH",
  6021. "hash": ""
  6022. },
  6023. {
  6024. "input": "http://example.org/test?a#%EF",
  6025. "base": "about:blank",
  6026. "href": "http://example.org/test?a#%EF",
  6027. "protocol": "http:",
  6028. "username": "",
  6029. "password": "",
  6030. "host": "example.org",
  6031. "hostname": "example.org",
  6032. "port": "",
  6033. "pathname": "/test",
  6034. "search": "?a",
  6035. "hash": "#%EF"
  6036. },
  6037. {
  6038. "input": "http://example.org/test?a#%GH",
  6039. "base": "about:blank",
  6040. "href": "http://example.org/test?a#%GH",
  6041. "protocol": "http:",
  6042. "username": "",
  6043. "password": "",
  6044. "host": "example.org",
  6045. "hostname": "example.org",
  6046. "port": "",
  6047. "pathname": "/test",
  6048. "search": "?a",
  6049. "hash": "#%GH"
  6050. },
  6051. "Bad bases",
  6052. {
  6053. "input": "test-a.html",
  6054. "base": "a",
  6055. "failure": true
  6056. },
  6057. {
  6058. "input": "test-a-slash.html",
  6059. "base": "a/",
  6060. "failure": true
  6061. },
  6062. {
  6063. "input": "test-a-slash-slash.html",
  6064. "base": "a//",
  6065. "failure": true
  6066. },
  6067. {
  6068. "input": "test-a-colon.html",
  6069. "base": "a:",
  6070. "failure": true
  6071. },
  6072. {
  6073. "input": "test-a-colon-slash.html",
  6074. "base": "a:/",
  6075. "href": "a:/test-a-colon-slash.html",
  6076. "protocol": "a:",
  6077. "username": "",
  6078. "password": "",
  6079. "host": "",
  6080. "hostname": "",
  6081. "port": "",
  6082. "pathname": "/test-a-colon-slash.html",
  6083. "search": "",
  6084. "hash": ""
  6085. },
  6086. {
  6087. "input": "test-a-colon-slash-slash.html",
  6088. "base": "a://",
  6089. "href": "a:///test-a-colon-slash-slash.html",
  6090. "protocol": "a:",
  6091. "username": "",
  6092. "password": "",
  6093. "host": "",
  6094. "hostname": "",
  6095. "port": "",
  6096. "pathname": "/test-a-colon-slash-slash.html",
  6097. "search": "",
  6098. "hash": ""
  6099. },
  6100. {
  6101. "input": "test-a-colon-b.html",
  6102. "base": "a:b",
  6103. "failure": true
  6104. },
  6105. {
  6106. "input": "test-a-colon-slash-b.html",
  6107. "base": "a:/b",
  6108. "href": "a:/test-a-colon-slash-b.html",
  6109. "protocol": "a:",
  6110. "username": "",
  6111. "password": "",
  6112. "host": "",
  6113. "hostname": "",
  6114. "port": "",
  6115. "pathname": "/test-a-colon-slash-b.html",
  6116. "search": "",
  6117. "hash": ""
  6118. },
  6119. {
  6120. "input": "test-a-colon-slash-slash-b.html",
  6121. "base": "a://b",
  6122. "href": "a://b/test-a-colon-slash-slash-b.html",
  6123. "protocol": "a:",
  6124. "username": "",
  6125. "password": "",
  6126. "host": "b",
  6127. "hostname": "b",
  6128. "port": "",
  6129. "pathname": "/test-a-colon-slash-slash-b.html",
  6130. "search": "",
  6131. "hash": ""
  6132. },
  6133. "Null code point in fragment",
  6134. {
  6135. "input": "http://example.org/test?a#b\u0000c",
  6136. "base": "about:blank",
  6137. "href": "http://example.org/test?a#bc",
  6138. "protocol": "http:",
  6139. "username": "",
  6140. "password": "",
  6141. "host": "example.org",
  6142. "hostname": "example.org",
  6143. "port": "",
  6144. "pathname": "/test",
  6145. "search": "?a",
  6146. "hash": "#bc"
  6147. }
  6148. ]