@sveltejs/kit 1.0.0-next.168 → 1.0.0-next.171

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -179,12 +179,13 @@ class Router {
179
179
  if (this.owns(url)) {
180
180
  const path = url.pathname.slice(this.base.length) || '/';
181
181
 
182
- const routes = this.routes.filter(([pattern]) => pattern.test(path));
182
+ const decoded_path = decodeURI(path);
183
+ const routes = this.routes.filter(([pattern]) => pattern.test(decoded_path));
183
184
 
184
185
  const query = new URLSearchParams(url.search);
185
186
  const id = `${path}?${query}`;
186
187
 
187
- return { id, routes, path, query };
188
+ return { id, routes, path, decoded_path, query };
188
189
  }
189
190
  }
190
191
 
@@ -913,8 +914,8 @@ class Renderer {
913
914
  * @param {boolean} no_cache
914
915
  * @returns {Promise<import('./types').NavigationResult | undefined>} undefined if fallthrough
915
916
  */
916
- async _load({ route, info: { path, query } }, no_cache) {
917
- const key = `${path}?${query}`;
917
+ async _load({ route, info: { path, decoded_path, query } }, no_cache) {
918
+ const key = `${decoded_path}?${query}`;
918
919
 
919
920
  if (!no_cache) {
920
921
  const cached = this.cache.get(key);
@@ -924,7 +925,7 @@ class Renderer {
924
925
  const [pattern, a, b, get_params] = route;
925
926
  const params = get_params
926
927
  ? // the pattern is for the route which we've already matched to this path
927
- get_params(/** @type {RegExpExecArray} */ (pattern.exec(path)))
928
+ get_params(/** @type {RegExpExecArray} */ (pattern.exec(decoded_path)))
928
929
  : {};
929
930
 
930
931
  const changed = this.current.page && {