Merge pull request #1656 from dalbani/patch-1
Simplify online validator URL building (HTTP[S]?)
This commit is contained in:
@@ -61,13 +61,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
|
|||||||
// Localhost override
|
// Localhost override
|
||||||
this.model.validatorUrl = null;
|
this.model.validatorUrl = null;
|
||||||
} else {
|
} else {
|
||||||
// Default validator
|
this.model.validatorUrl = '//online.swagger.io/validator';
|
||||||
if(window.location.protocol === 'https:') {
|
|
||||||
this.model.validatorUrl = 'https://online.swagger.io/validator';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.model.validatorUrl = 'http://online.swagger.io/validator';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// JSonEditor requires type='object' to be present on defined types, we add it if it's missing
|
// JSonEditor requires type='object' to be present on defined types, we add it if it's missing
|
||||||
|
|||||||
Reference in New Issue
Block a user