added fix from outdated PR #1122
This commit is contained in:
14
dist/swagger-ui.js
vendored
14
dist/swagger-ui.js
vendored
@@ -20867,7 +20867,9 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
||||
} else {
|
||||
|
||||
// Default validator
|
||||
this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator';
|
||||
if(window.location.protocol.startsWith('http')) {
|
||||
this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator';
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -21252,7 +21254,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
if (isFileUpload) {
|
||||
return this.handleFileUpload(map, form);
|
||||
} else {
|
||||
return this.model['do'](map, opts, this.showCompleteStatus, this.showErrorStatus, this);
|
||||
return this.model.execute(map, this.options.swaggerOptions || {}, this.showCompleteStatus, this.showErrorStatus, this);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -21547,10 +21549,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
pre = $('<audio controls>').append($('<source>').attr('src', url).attr('type', contentType));
|
||||
|
||||
// Download
|
||||
} else if (headers['Content-Disposition'].test(/attachment/) ||
|
||||
headers['content-disposition'].test(/attachment/) ||
|
||||
headers['Content-Description'].test(/File Transfer/) ||
|
||||
headers['content-description'].test(/File Transfer/)) {
|
||||
} else if ((headers['Content-Disposition'] && headers['Content-Disposition'].test(/attachment/)) ||
|
||||
(headers['content-disposition'] && headers['content-disposition'].test(/attachment/)) ||
|
||||
(headers['Content-Description'] && headers['Content-Description'].test(/File Transfer/)) ||
|
||||
(headers['content-description'] && headers['content-description'].test(/File Transfer/))) {
|
||||
|
||||
if ('Blob' in window) {
|
||||
var type = contentType || 'text/html';
|
||||
|
||||
2
dist/swagger-ui.min.js
vendored
2
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -608,10 +608,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
pre = $('<audio controls>').append($('<source>').attr('src', url).attr('type', contentType));
|
||||
|
||||
// Download
|
||||
} else if (headers['Content-Disposition'].test(/attachment/) ||
|
||||
headers['content-disposition'].test(/attachment/) ||
|
||||
headers['Content-Description'].test(/File Transfer/) ||
|
||||
headers['content-description'].test(/File Transfer/)) {
|
||||
} else if ((headers['Content-Disposition'] && headers['Content-Disposition'].test(/attachment/)) ||
|
||||
(headers['content-disposition'] && headers['content-disposition'].test(/attachment/)) ||
|
||||
(headers['Content-Description'] && headers['Content-Description'].test(/File Transfer/)) ||
|
||||
(headers['content-description'] && headers['content-description'].test(/File Transfer/))) {
|
||||
|
||||
if ('Blob' in window) {
|
||||
var type = contentType || 'text/html';
|
||||
|
||||
Reference in New Issue
Block a user