From 3789e5bac97271fbbd4b372695cc4ab243a36c76 Mon Sep 17 00:00:00 2001 From: Andre Savic Date: Mon, 11 Jan 2021 22:45:46 +0100 Subject: [PATCH] Add capacitorjs support --- timesync-server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/timesync-server.js b/timesync-server.js index c362697..887b912 100644 --- a/timesync-server.js +++ b/timesync-server.js @@ -18,8 +18,9 @@ WebApp.rawConnectHandlers.use("/_timesync", // and http://meteor.local for earlier versions const origin = req.headers.origin; - if (origin && ( origin === 'http://meteor.local' || - origin === 'meteor://desktop' || + if (origin && ( origin === 'http://meteor.local' || + origin === 'capacitor://meteor.local' || + origin === 'meteor://desktop' || /^http:\/\/localhost:1[23]\d\d\d$/.test(origin) ) ) { res.setHeader('Access-Control-Allow-Origin', origin); }