From f2e7103848c7f578ba6bca08198ef36afaf6c13f Mon Sep 17 00:00:00 2001 From: sirpy Date: Mon, 23 Jan 2017 13:44:41 +0200 Subject: [PATCH] fix cordova issue with headersHelper.js on android cordova the following error is shown Uncaught SyntaxError: Unexpected token < this is probably because on android the app is always on localhost. hopefully using Meteor.absoluteUrl will fix this issue and use the ROOT_URL as defined in compilation --- lib/headers-client.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/headers-client.js b/lib/headers-client.js index d1b6b9b..8cfda8b 100644 --- a/lib/headers-client.js +++ b/lib/headers-client.js @@ -64,10 +64,11 @@ if (__headers__) { * why this is necessary). Called with our unique token, the retrieved * code runs headers.store() above with the results */ + var baseUrl = Meteor.absoluteUrl('/headersHelper.js?token=' + headers.token); (function(d, t) { var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; - g.src = '/headersHelper.js?token=' + headers.token; + g.src = baseUrl; s.parentNode.insertBefore(g, s); }(document, 'script')); }