Skip to content

Commit

Permalink
Resolve pathnames that contain dot segments. deprecate#19
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Frampton authored and Robert-Frampton committed Oct 18, 2017
1 parent 280efd7 commit 0a0b06f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"metal": "^2.0.0",
"metal-structs": "^1.0.0",
"path-browserify": "0.0.0",
"resolve-pathname": "^2.2.0",
"url-parse": "^1.1.9"
},
"devDependencies": {
Expand Down
11 changes: 9 additions & 2 deletions src/Uri.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use strict';

import { isDef, string } from 'metal';
import parse from './parse';
import resolvePathname from 'resolve-pathname';
import { MultiMap } from 'metal-structs';
import { isDef, string } from 'metal';

var parseFn_ = parse;

Expand Down Expand Up @@ -197,7 +198,13 @@ class Uri {
* @return {string}
*/
getPathname() {
return this.url.pathname;
let { pathname } = this.url;

if (pathname && pathname.indexOf('.') > -1) {
pathname = resolvePathname(pathname);
}

return pathname;
}

/**
Expand Down

0 comments on commit 0a0b06f

Please sign in to comment.