Support fragments in url

support fragments in url when there are no defined explicit servers
This commit is contained in:
Luis Tejeda
2022-07-18 12:12:32 -05:00
parent ad78625271
commit 99e7f66044
3 changed files with 67 additions and 7 deletions

View File

@@ -2609,6 +2609,9 @@ module.exports = {
// Return no matches for invalid url (if unable to decode parsed url)
try {
pathToMatch = decodeURI(parsedUrl.pathname);
if (!_.isNil(parsedUrl.hash)) {
pathToMatch += parsedUrl.hash;
}
}
catch (e) {
console.warn(
@@ -4458,11 +4461,7 @@ module.exports = {
pathToMatchArr = _.reject(pathToMatch.split('/'), (segment) => {
return segment === '';
}),
pathToMatchSegments = pathToMatchArr.length,
fragments = schemaPath.split('#');
if (fragments.length > 1) {
fragment = '#' + fragments[1];
}
pathToMatchSegments = pathToMatchArr.length;
if (pathToMatchSegments < schemaPathSegments) {
return pathToMatch;
}