swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

swagger-ui is requesting the validator over http even when swagger-ui was loaded over https

Open ftortega opened this issue 11 years ago • 7 comments

I believe the problem is in the following IF block

      // Default validator
      if(window.location.protocol === 'https') {
        this.model.validatorUrl = 'https://online.swagger.io/validator';
      }

in my browser (Chrome Version 43.0.2357.130 m (64-bit)) window.location.protocol returns https: with a colon :, However even when I changed that line to:

 if((window.location.protocol).indexOf('https') !== -1) {

I still get a Mixed Content warning in the console saying that my page requested an insecure image.

ftortega avatar Jul 02 '15 19:07 ftortega

You can disable the validator by using:

validatorUrl: null

Put this in the area where you render the SwaggerUi object

shawngong avatar Jul 03 '15 14:07 shawngong

#1427 offers a partial fix. However, right now we don't really host the validator on https (it will redirect to http).

webron avatar Jul 05 '15 11:07 webron

so no chance you will ever host a validator behind https? its pretty annoying.

danlangford avatar Aug 14 '15 22:08 danlangford

we will move it under https. It just doesn't happen automatically, so it takes a bit of time.

fehguy avatar Aug 14 '15 22:08 fehguy

Would be great if you could move the validator to https.

guido4000 avatar Oct 30 '15 19:10 guido4000

@guido4000 - it's already running on https as well.

webron avatar Oct 30 '15 23:10 webron

@webron I do get redirected from https://online.swagger.io/validator to http://online.swagger.io/validator/

guido4000 avatar Oct 31 '15 22:10 guido4000