Commit 18ce470f authored by Tony Tam's avatar Tony Tam
Browse files
parent 53593b79
......@@ -1001,7 +1001,7 @@
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
param = _ref[_i];
if (type.toLowerCase() === "file") {
if (typeof type !== 'undefined' && type.toLowerCase() === "file") {
_results.push(param);
}
}
......
......@@ -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;
}
};
......
This diff is collapsed.
......@@ -1001,7 +1001,7 @@
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
param = _ref[_i];
if (type.toLowerCase() === "file") {
if (typeof type !== 'undefined' && type.toLowerCase() === "file") {
_results.push(param);
}
}
......
......@@ -69,13 +69,20 @@ class SwaggerUi extends Backbone.Router
buildUrl: (base, url) ->
log "base is " + base
parts = base.split("/")
base = parts[0] + "//" + parts[2]
if url.indexOf("/") is 0
parts = base.split("/")
base = parts[0] + "//" + parts[2]
base + url
else
base + "/" + url
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 ) isnt -1
return base + url
return base + "/" + url
# Shows message on topbar of the ui
showMessage: (data = '') ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment