Skip to content
Snippets Groups Projects
Commit 1e5ed548 authored by Antoine Prieels's avatar Antoine Prieels
Browse files

[IMP] pos_restaurant: Order printers with HTTPS

To use a kitchen printer, the user can only enter the IP of the Box and
it would be transformed into an URL with the protocol and port number.
This only supported HTTP so people that used HTTPS needed to enter the
full url to their Box.
parent f2230f44
Branches
Tags
No related merge requests found
......@@ -12,9 +12,9 @@ models.PosModel = models.PosModel.extend({
create_printer: function (config) {
var url = config.proxy_ip || '';
if(url.indexOf('//') < 0) {
url = 'http://' + url;
url = window.location.protocol + '//' + url;
}
if(url.indexOf(':', url.indexOf('//') + 2) < 0) {
if(url.indexOf(':', url.indexOf('//') + 2) < 0 && window.location.protocol !== 'https:') {
url = url + ':8069';
}
return new Printer(url, this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment