| 955 | * @param {Pilot} [router] |
| 956 | */ |
| 957 | var Request = function (url, referrer, router) { |
| 958 | url = new URL(url); |
| 959 | |
| 960 | this.href = url.href; |
| 961 | this.protocol = url.protocol; |
| 962 | this.host = url.host; |
| 963 | this.hostname = url.hostname; |
| 964 | this.port = url.port; |
| 965 | |
| 966 | this.path = |
| 967 | this.pathname = url.pathname; |
| 968 | |
| 969 | this.search = url.search; |
| 970 | this.query = queryString.parse(url.search); |
| 971 | this.params = {}; |
| 972 | |
| 973 | this.hash = url.hash; |
| 974 | |
| 975 | this.route = router && (router.route || router.activeRoute) || {}; |
| 976 | this.router = router; |
| 977 | this.referrer = referrer; |
| 978 | this.redirectHref = null; |
| 979 | |
| 980 | // Алиас, который сматчился |
| 981 | this.alias = void 0; |
| 982 | }; |
| 983 | |
| 984 | |
| 985 | Request.prototype = /** @lends Request# */{ |