Merge pull request #1656 from dalbani/patch-1

Simplify online validator URL building (HTTP[S]?)
This commit is contained in:
Tony Tam
2016-08-10 13:52:36 +02:00
committed by GitHub

View File

@@ -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