PageRenderTime 54ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/third_party/rust/url/tests/urltestdata.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

Large files files are truncated, but you can click here to view the full file

  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"

Large files files are truncated, but you can click here to view the full file