fixed MainView for ES5 browser.

calling ES6 String.prototype.startWith doesn't work in all browsers
yet.
This commit is contained in:
Matthias Le Brun
2015-05-13 14:34:09 +02:00
parent bf7164119b
commit 082dc476e6
3 changed files with 356 additions and 358 deletions

View File

@@ -68,7 +68,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
} else {
// Default validator
if(window.location.protocol.startsWith('http')) {
if(window.location.protocol.indexOf('http') === 0) {
this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator';
}
}