diff --git a/package.json b/package.json index dc2b915..0a89f1b 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/Uri.js b/src/Uri.js index 816e0d5..7988703 100644 --- a/src/Uri.js +++ b/src/Uri.js @@ -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; @@ -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; } /**