Skip to content

Commit

Permalink
Fix condition for orign secure check
Browse files Browse the repository at this point in the history
  • Loading branch information
annmirosh committed Nov 6, 2020
1 parent 0e4e657 commit 93c9869
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions dist/alan_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -2347,17 +2347,19 @@ function alanBtn(options) {

function isOriginSecure() {
var isSecure = false;
var protocol = window.location.protocol
var hostname = window.location.hostname

if (window.location.protocol === 'https:') {
if (protocol === 'https:') {
isSecure = true;
}

if (window.location.protocol === 'file:') {
if (protocol === 'file:') {
isSecure = true;
}

if (window.location.protocol === 'http:' && window.location.hostname === 'localhost') {
isSecure = true;
if (protocol === 'http:' && (hostname === 'localhost' || hostname === '127.0.0.1')) {
isSecure = true;
}

return isSecure;
Expand Down
2 changes: 1 addition & 1 deletion dist/alan_lib.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alan-ai/alan-sdk-web",
"version": "1.8.1",
"version": "1.8.2",
"description": "Alan Web SDK: a lightweight JavaScript library for adding a voice experience to your website or web application",
"keywords": [
"alan sdk web",
Expand Down

0 comments on commit 93c9869

Please sign in to comment.