From fdbde4ecf583128ebbe7d7736bd02ffb27c0df96 Mon Sep 17 00:00:00 2001 From: fox <83943819+fewkz@users.noreply.github.com> Date: Thu, 29 Sep 2022 13:52:35 -0400 Subject: [PATCH 1/2] Support explicitly specifying http or https protocol in plugin --- plugin/src/App/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index 9f7e2ecf6..725678b1c 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -202,7 +202,9 @@ function App:startSession() twoWaySync = Settings:get("twoWaySync"), } - local baseUrl = ("http://%s:%s"):format(host, port) + local baseUrl = if string.find(host, "^https?://") + then string.format("%s:%d", host, port) + else string.format("http://%s:%d", host, port) local apiContext = ApiContext.new(baseUrl) local serveSession = ServeSession.new({ From d13b50bdc5b1c8cf3c242c75bed7d1b3f457b6aa Mon Sep 17 00:00:00 2001 From: fox <83943819+fewkz@users.noreply.github.com> Date: Thu, 29 Sep 2022 14:02:17 -0400 Subject: [PATCH 2/2] Fix incorrect format string Port is not a number --- plugin/src/App/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/src/App/init.lua b/plugin/src/App/init.lua index 725678b1c..931860772 100644 --- a/plugin/src/App/init.lua +++ b/plugin/src/App/init.lua @@ -203,8 +203,8 @@ function App:startSession() } local baseUrl = if string.find(host, "^https?://") - then string.format("%s:%d", host, port) - else string.format("http://%s:%d", host, port) + then string.format("%s:%s", host, port) + else string.format("http://%s:%s", host, port) local apiContext = ApiContext.new(baseUrl) local serveSession = ServeSession.new({