Skip to content

Commit 465164e

Browse files
authored
Merge pull request #1656 from dalbani/patch-1
Simplify online validator URL building (HTTP[S]?)
2 parents 4d08591 + a201d18 commit 465164e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/main/javascript/view/MainView.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
6161
// Localhost override
6262
this.model.validatorUrl = null;
6363
} else {
64-
// Default validator
65-
if(window.location.protocol === 'https:') {
66-
this.model.validatorUrl = 'https://online.swagger.io/validator';
67-
}
68-
else {
69-
this.model.validatorUrl = 'http://online.swagger.io/validator';
70-
}
64+
this.model.validatorUrl = '//online.swagger.io/validator';
7165
}
7266

7367
// JSonEditor requires type='object' to be present on defined types, we add it if it's missing

0 commit comments

Comments
 (0)