Skip to content

Commit

Permalink
[Local XLIFF Watcher] Partial Fix of Issue #76: Use https protocol as…
Browse files Browse the repository at this point in the history
… a fallback
  • Loading branch information
t2ym committed Jun 23, 2017
1 parent 295b2f0 commit 16d00c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion live-localizer-local-file-storage.html
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@
this.tooltip = 'Error in watching ' + this.url +
' Be sure to launch HTTP server at http://localhost:' + this.watchPort +
' with the uploaded XLIFF in the HTTP root folder';
if (window.location.protocol === 'http:') {
this.watcherProtocolHttps = !this.watcherProtocolHttps;
}
timeout = 10000;
break;
case 'start':
Expand All @@ -569,7 +572,7 @@
}

this.timeoutID = setTimeout(function () {
this.url = window.location.protocol + '//localhost:' + this.watchPort + this.watchPath + this.files[0].name;
this.url = (this.watcherProtocolHttps ? 'https:' : window.location.protocol) + '//localhost:' + this.watchPort + this.watchPath + this.files[0].name;
this.xhr.open('GET', this.url);
if (this.lastModified) {
this.xhr.setRequestHeader('If-Modified-Since', this.lastModified);
Expand Down

0 comments on commit 16d00c2

Please sign in to comment.