Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adon committed Oct 29, 2015
1 parent 51f7322 commit 9370e7e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/lib/urlResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,20 @@ x.yUrlResolver = function (schemes) {
auth, hostname, port) + path;
},
relCallback: function(path) {
var pos = -1, bPath = _baseURL[2];
var pos = -1, hashPos = -1, bPath = _baseURL[2];
if (path.length === 0) {
return _baseURL[0] + bPath;
}
switch(path.charCodeAt(0)) {
case 47: case 92: /* / or \ */
return _baseURL[0] + path;
case 63: /* ? */
(pos = bPath.indexOf('?')) === -1 &&
(pos = bPath.indexOf('#')); break;
pos = bPath.indexOf('?');
hashPos = bPath.indexOf('#');
if (pos === -1 || hashPos !== -1 && hashPos < pos) {
pos = hashPos;
}
break;
case 35: /* # */
pos = bPath.indexOf('#'); break;
default: // else
Expand Down

0 comments on commit 9370e7e

Please sign in to comment.