{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1382","repository_url":"https://api.github.com/repos/swagger-api/swagger-ui","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1382/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1382/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1382/events","html_url":"https://github.com/swagger-api/swagger-ui/issues/1382","id":89572652,"number":1382,"title":"Swagger ui 'Try it out!' calls http on https page and the request is blocked","user":{"login":"brenovieira","id":7158650,"avatar_url":"https://avatars.githubusercontent.com/u/7158650?v=3","gravatar_id":"","url":"https://api.github.com/users/brenovieira","html_url":"https://github.com/brenovieira","followers_url":"https://api.github.com/users/brenovieira/followers","following_url":"https://api.github.com/users/brenovieira/following{/other_user}","gists_url":"https://api.github.com/users/brenovieira/gists{/gist_id}","starred_url":"https://api.github.com/users/brenovieira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brenovieira/subscriptions","organizations_url":"https://api.github.com/users/brenovieira/orgs","repos_url":"https://api.github.com/users/brenovieira/repos","events_url":"https://api.github.com/users/brenovieira/events{/privacy}","received_events_url":"https://api.github.com/users/brenovieira/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2015-06-19T14:03:40Z","updated_at":"2016-09-08T20:36:25Z","closed_at":"2015-12-09T20:15:56Z","body":"My swagger.json is the following (replacing '...' and 'IP' with some data):\r\n\r\n```javascript\r\n{\r\n\t\"swagger\": \"2.0\",\r\n\t\"info\": {\r\n\t\t\"version\": \"v1\",\r\n\t\t\"title\": \"Documentation for API\",\r\n\t\t\"description\": \"...\"\r\n\t},\r\n\t\"host\": \"IP:3030\",\r\n\t\"schemes\": [\"http\",\t\"https\"],\r\n\t\"paths\": {\r\n\t\t\"...\": { ... }\r\n\t},\r\n\t\"definitions\": {\r\n\t\t\"...\": { ... }\r\n\t}\r\n}\r\n```\r\n\r\nAnd I'm calling the swagger-ui in this function (docs.js):\r\n\r\n```javascript\r\n$(function () {\r\n    var version = window.location.href.match(/v\\d+(\\.\\d+)*/); //any v1, v1.2, v1.2.3 ...\r\n    version = version && version[0] ? version[0] : 'v1';\r\n    var url = window.location.origin + '/docs/' + version;\r\n\r\n    window.swaggerUi = new SwaggerUi({\r\n        url: url,\r\n        dom_id: \"swagger-ui-container\",\r\n        validatorUrl: null,\r\n        supportedSubmitMethods: ['get', 'post', 'put', 'delete'],\r\n        onComplete: function (swaggerApi, swaggerUi) {\r\n            console.log(\"Loaded SwaggerUI\");\r\n            \r\n            $('pre code').each(function (i, e) {\r\n                hljs.highlightBlock(e)\r\n            });\r\n\r\n            $('#api_info').addClass('container');\r\n            $('input[name=grant_type]').val('password');\r\n        },\r\n        onFailure: function (data) {\r\n           console.log(\"Unable to Load SwaggerUI\");\r\n        },\r\n        docExpansion: \"none\",\r\n        apisSorter: \"alpha\",\r\n        //operationsSorter: \"alpha\"\r\n    });\r\n\r\n    window.swaggerUi.load();\r\n});\r\n```\r\nAnd the index.html is this:\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n    <meta content=\"IE=edge, chrome=1\" http-equiv=\"X-UA-Compatible\" />\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\" />\r\n    <link rel=\"shortcut icon\" href=\"/favicon.ico\" />\r\n    <title>API Docs</title>\r\n    <link href=\"/docs/css/typography.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n\t<link href=\"/docs/css/reset.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n    <link href=\"/docs/css/screen.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n    <link href=\"/app/css/bootswatch/bootstrap.min.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n    <link href=\"/app/css/site.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\r\n\r\n    <script src=\"/docs/lib/jquery-1.8.0.min.js\" type=\"text/javascript\"></script>\r\n    <script src=\"/docs/lib/jquery.slideto.min.js\" type=\"text/javascript\"></script>\r\n    <script src=\"/docs/lib/jquery.wiggle.min.js\" type=\"text/javascript\"></script>\r\n    <script src=\"/docs/lib/jquery.ba-bbq.min.js\" type=\"text/javascript\"></script>\r\n    <script src=\"/docs/lib/handlebars-2.0.0.js\" type=\"text/javascript\"></script>\r\n    <script src=\"/docs/lib/underscore-min.js\" type=\"text/javascript\"></script>\r\n    <script src=\"/docs/lib/backbone-min.js\" type=\"text/javascript\"></script>\r\n    <script src=\"/docs/swagger-ui.js\" type=\"text/javascript\"></script>\r\n    <script src=\"/docs/lib/highlight.7.3.pack.js\" type=\"text/javascript\"></script>\r\n\t<script src=\"/docs/lib/marked.js\" type=\"text/javascript\"></script>\r\n\r\n    <!-- enabling this will enable oauth2 implicit scope support -->\r\n    <!--<script src=\"lib/swagger-oauth.js\" type=\"text/javascript\"></script>-->\r\n    <script src=\"/docs/docs.js\" type=\"text/javascript\"></script>\r\n</head>\r\n<body class=\"swagger-section\">\r\n    <div class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\r\n        <div class=\"container\">\r\n            <div class=\"navbar-header\">\r\n                <button class=\"btn btn-success navbar-toggle\">\r\n                    <span class=\"glyphicon glyphicon-chevron-down\"></span>\r\n                </button>\r\n                <a class=\"navbar-brand\" href=\"/\">\r\n                    <img src=\"/app/images/logogif\" alt=\"Logo\" />\r\n                </a>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    \r\n    <div style=\"margin-top:65px\">\r\n        <div id=\"message-bar\" class=\"swagger-ui-wrap\">&nbsp;</div>\r\n        <div id=\"swagger-ui-container\" class=\"swagger-ui-wrap\"></div>\r\n    </div>\r\n</body>\r\n</html>\r\n```\r\nWhen I 'Try it out!' my methods, I'm getting the following error on Google Chrome:\r\n\r\n> Mixed Content: The page at 'https://IP:3030/docs/#!/Auth/AuthHb_Login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://IP:3030/api/auth'. This request has been blocked; the content must be served over HTTPS.\r\n\r\nShould my swagger.json \"schemes\" be only [\"https\"] ? I'm asking this, because I have dev, uat and prod environments and we don't use https in dev (just in uat and production).\r\n\r\nBy the way, I'm using Swashbuckle (.NET) and swagger-ui.js version 2.1.0 (using the pre-built files in the dist folder). Related issue #1006."},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/comments/245732071","html_url":"https://github.com/swagger-api/swagger-ui/issues/1382#issuecomment-245732071","issue_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/1382","id":245732071,"user":{"login":"fyinnit","id":19232359,"avatar_url":"https://avatars.githubusercontent.com/u/19232359?v=3","gravatar_id":"","url":"https://api.github.com/users/fyinnit","html_url":"https://github.com/fyinnit","followers_url":"https://api.github.com/users/fyinnit/followers","following_url":"https://api.github.com/users/fyinnit/following{/other_user}","gists_url":"https://api.github.com/users/fyinnit/gists{/gist_id}","starred_url":"https://api.github.com/users/fyinnit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyinnit/subscriptions","organizations_url":"https://api.github.com/users/fyinnit/orgs","repos_url":"https://api.github.com/users/fyinnit/repos","events_url":"https://api.github.com/users/fyinnit/events{/privacy}","received_events_url":"https://api.github.com/users/fyinnit/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T20:36:25Z","updated_at":"2016-09-08T20:36:25Z","body":"I met this issue too. It would be nice if it could be fixed. Thanks."}}
{"actor":{"display_login":"fyinnit"}}