Skip to content

Commit

Permalink
Fixed the URL decoding in the 'Path' class to be able to work with fu…
Browse files Browse the repository at this point in the history
…lly encoded and partially encoded URL
  • Loading branch information
AdrienCastex committed Jul 31, 2017
1 parent ad5c8a6 commit 5a743a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/manager/v2/Path.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var Path = (function () {
this.paths = path.paths.filter(function (x) { return true; }); // clone
else
this.paths = path;
this.paths = this.paths.filter(function (p) { return p.length > 0; });
this.paths = this.paths.filter(function (p) { return p.length > 0; }).map(function (s) { return decodeURIComponent(s); });
}
Path.prototype.isRoot = function () {
return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
Expand Down
2 changes: 1 addition & 1 deletion src/manager/v2/Path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class Path
else
this.paths = path as string[];

this.paths = this.paths.filter((p) => p.length > 0);
this.paths = this.paths.filter((p) => p.length > 0).map((s) => decodeURIComponent(s));
}

isRoot() : boolean
Expand Down

0 comments on commit 5a743a9

Please sign in to comment.