This commit is contained in:
17
dist/swagger-ui.js
vendored
17
dist/swagger-ui.js
vendored
@@ -1281,13 +1281,24 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
|
||||
};
|
||||
|
||||
SwaggerUi.prototype.buildUrl = function(base, url) {
|
||||
var parts;
|
||||
var endOfPath, parts;
|
||||
log("base is " + base);
|
||||
parts = base.split("/");
|
||||
base = parts[0] + "//" + parts[2];
|
||||
if (url.indexOf("/") === 0) {
|
||||
parts = base.split("/");
|
||||
base = parts[0] + "//" + parts[2];
|
||||
return base + url;
|
||||
} else {
|
||||
endOfPath = base.length;
|
||||
if (base.indexOf("?") > -1) {
|
||||
endOfPath = Math.min(endOfPath, base.indexOf("?"));
|
||||
}
|
||||
if (base.indexOf("#") > -1) {
|
||||
endOfPath = Math.min(endOfPath, base.indexOf("#"));
|
||||
}
|
||||
base = base.substring(0, endOfPath);
|
||||
if (base.indexOf("/", base.length - 1) !== -1) {
|
||||
return base + url;
|
||||
}
|
||||
return base + "/" + url;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user