diff --git a/mds/code/basic/mds.js b/mds/code/basic/mds.js index 4815ea23c..8933b11ef 100644 --- a/mds/code/basic/mds.js +++ b/mds/code/basic/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/blockscan/mds.js b/mds/code/blockscan/mds.js index 4815ea23c..8933b11ef 100644 --- a/mds/code/blockscan/mds.js +++ b/mds/code/blockscan/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/bonds/mds.js b/mds/code/bonds/mds.js index db2e7d786..154f7beb8 100644 --- a/mds/code/bonds/mds.js +++ b/mds/code/bonds/mds.js @@ -71,7 +71,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/bridge/mds.js b/mds/code/bridge/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/bridge/mds.js +++ b/mds/code/bridge/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/cevt/payment/mds.js b/mds/code/cevt/payment/mds.js index 33875efa2..8438cd7ab 100644 --- a/mds/code/cevt/payment/mds.js +++ b/mds/code/cevt/payment/mds.js @@ -71,7 +71,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/cevt/terminal/mds.js b/mds/code/cevt/terminal/mds.js index 33875efa2..8438cd7ab 100644 --- a/mds/code/cevt/terminal/mds.js +++ b/mds/code/cevt/terminal/mds.js @@ -71,7 +71,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/chainmail/miniweb/libs/mds.js b/mds/code/chainmail/miniweb/libs/mds.js index 4815ea23c..8933b11ef 100644 --- a/mds/code/chainmail/miniweb/libs/mds.js +++ b/mds/code/chainmail/miniweb/libs/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/chatter/mds.js b/mds/code/chatter/mds.js index b2ec5ba5e..b990cbef7 100644 --- a/mds/code/chatter/mds.js +++ b/mds/code/chatter/mds.js @@ -71,7 +71,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/coincheck/mds.js b/mds/code/coincheck/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/coincheck/mds.js +++ b/mds/code/coincheck/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/dexxed/mds.js b/mds/code/dexxed/mds.js index 68e1d7104..d4e90590e 100644 --- a/mds/code/dexxed/mds.js +++ b/mds/code/dexxed/mds.js @@ -72,10 +72,18 @@ var MDS = { //The ports.. var mainport = port+1; - MDS.filehost = "https://"+host+":"+port+"/"; + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + } MDS.log("MDS FILEHOST : "+MDS.filehost); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/ethwallettest/mds.js b/mds/code/ethwallettest/mds.js index 4815ea23c..8933b11ef 100644 --- a/mds/code/ethwallettest/mds.js +++ b/mds/code/ethwallettest/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/files/mds.js b/mds/code/files/mds.js index f820512e7..e51e7f189 100644 --- a/mds/code/files/mds.js +++ b/mds/code/files/mds.js @@ -71,7 +71,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/htlc/mds.js b/mds/code/htlc/mds.js index 54a487294..d23cc228f 100644 --- a/mds/code/htlc/mds.js +++ b/mds/code/htlc/mds.js @@ -83,7 +83,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/htlc/rescue/mds.js b/mds/code/htlc/rescue/mds.js index 10791dedc..16303f2aa 100644 --- a/mds/code/htlc/rescue/mds.js +++ b/mds/code/htlc/rescue/mds.js @@ -72,10 +72,18 @@ var MDS = { //The ports.. var mainport = port+1; - MDS.filehost = "https://"+host+":"+port+"/"; + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + } MDS.log("MDS FILEHOST : "+MDS.filehost); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/linux/mds.js b/mds/code/linux/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/linux/mds.js +++ b/mds/code/linux/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/lotto/mds.js b/mds/code/lotto/mds.js index 49f3bf9e1..3744645c9 100644 --- a/mds/code/lotto/mds.js +++ b/mds/code/lotto/mds.js @@ -72,10 +72,18 @@ var MDS = { //The ports.. var mainport = port+1; - MDS.filehost = "https://"+host+":"+port+"/"; + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + } MDS.log("MDS FILEHOST : "+MDS.filehost); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/maxchat/mds.js b/mds/code/maxchat/mds.js index 4815ea23c..8933b11ef 100644 --- a/mds/code/maxchat/mds.js +++ b/mds/code/maxchat/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/maxsolo/mds.js b/mds/code/maxsolo/mds.js index dd59f850b..fcb7f3bec 100644 --- a/mds/code/maxsolo/mds.js +++ b/mds/code/maxsolo/mds.js @@ -71,7 +71,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/mdsapi/mds.js b/mds/code/mdsapi/mds.js index 9e10c0282..829b9b748 100644 --- a/mds/code/mdsapi/mds.js +++ b/mds/code/mdsapi/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/minifs/mds.js b/mds/code/minifs/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/minifs/mds.js +++ b/mds/code/minifs/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/minihub/mds.js b/mds/code/minihub/mds.js index 10791dedc..16303f2aa 100644 --- a/mds/code/minihub/mds.js +++ b/mds/code/minihub/mds.js @@ -72,10 +72,18 @@ var MDS = { //The ports.. var mainport = port+1; - MDS.filehost = "https://"+host+":"+port+"/"; + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + } MDS.log("MDS FILEHOST : "+MDS.filehost); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/minimaide/js/mds.js b/mds/code/minimaide/js/mds.js index 10791dedc..16303f2aa 100644 --- a/mds/code/minimaide/js/mds.js +++ b/mds/code/minimaide/js/mds.js @@ -72,10 +72,18 @@ var MDS = { //The ports.. var mainport = port+1; - MDS.filehost = "https://"+host+":"+port+"/"; + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + } MDS.log("MDS FILEHOST : "+MDS.filehost); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/minimaide/mds.js b/mds/code/minimaide/mds.js index 10791dedc..16303f2aa 100644 --- a/mds/code/minimaide/mds.js +++ b/mds/code/minimaide/mds.js @@ -72,10 +72,18 @@ var MDS = { //The ports.. var mainport = port+1; - MDS.filehost = "https://"+host+":"+port+"/"; + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + } MDS.log("MDS FILEHOST : "+MDS.filehost); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/miniweb/mds.js b/mds/code/miniweb/mds.js index 4815ea23c..8933b11ef 100644 --- a/mds/code/miniweb/mds.js +++ b/mds/code/miniweb/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/miniweb/root/miniweb/libs/mds.js b/mds/code/miniweb/root/miniweb/libs/mds.js index 4815ea23c..8933b11ef 100644 --- a/mds/code/miniweb/root/miniweb/libs/mds.js +++ b/mds/code/miniweb/root/miniweb/libs/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/miniweb/root/miniweb/mds.js b/mds/code/miniweb/root/miniweb/mds.js index 4815ea23c..8933b11ef 100644 --- a/mds/code/miniweb/root/miniweb/mds.js +++ b/mds/code/miniweb/root/miniweb/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/mns/mds.js b/mds/code/mns/mds.js index 9e10c0282..829b9b748 100644 --- a/mds/code/mns/mds.js +++ b/mds/code/mns/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/mnsweb/mds.js b/mds/code/mnsweb/mds.js index 834877e2d..ed796ab9a 100644 --- a/mds/code/mnsweb/mds.js +++ b/mds/code/mnsweb/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/nftmarket/mds.js b/mds/code/nftmarket/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/nftmarket/mds.js +++ b/mds/code/nftmarket/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/paychecker/mds.js b/mds/code/paychecker/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/paychecker/mds.js +++ b/mds/code/paychecker/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/publicwallet/mds.js b/mds/code/publicwallet/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/publicwallet/mds.js +++ b/mds/code/publicwallet/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/scriptide/js/mds.js b/mds/code/scriptide/js/mds.js index 834877e2d..ed796ab9a 100644 --- a/mds/code/scriptide/js/mds.js +++ b/mds/code/scriptide/js/mds.js @@ -74,8 +74,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/shoutout/mds.js b/mds/code/shoutout/mds.js index 76580a02f..58096b5f1 100644 --- a/mds/code/shoutout/mds.js +++ b/mds/code/shoutout/mds.js @@ -68,8 +68,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://" + host + ":" + port + "/"; - MDS.mainhost = "https://" + host + ":" + port + "/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://" + host + "/"; + MDS.mainhost = "https://" + host + "/mdscommand_/"; + }else{ + MDS.filehost = "https://" + host + ":" + port + "/"; + MDS.mainhost = "https://" + host + ":" + port + "/mdscommand_/"; + } MDS.log("MDS HOST : " + MDS.filehost); //Store this for poll messages diff --git a/mds/code/sqlbench/mds.js b/mds/code/sqlbench/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/sqlbench/mds.js +++ b/mds/code/sqlbench/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/synccmd/mds.js b/mds/code/synccmd/mds.js index b90a44d78..2dbb757df 100644 --- a/mds/code/synccmd/mds.js +++ b/mds/code/synccmd/mds.js @@ -71,7 +71,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/terminal-1.0/mds.js b/mds/code/terminal-1.0/mds.js index 9ba417e75..9db1ced98 100644 --- a/mds/code/terminal-1.0/mds.js +++ b/mds/code/terminal-1.0/mds.js @@ -84,7 +84,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); //MDS.mainhost = "https://"+host+":"+mainport+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/terminal-2.1.0/assets/mds.js b/mds/code/terminal-2.1.0/assets/mds.js index 80524d161..4ff24dd8d 100644 --- a/mds/code/terminal-2.1.0/assets/mds.js +++ b/mds/code/terminal-2.1.0/assets/mds.js @@ -83,7 +83,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/terminal-2.1.0/mds.js b/mds/code/terminal-2.1.0/mds.js index 7fca481fc..6bdd02f5e 100644 --- a/mds/code/terminal-2.1.0/mds.js +++ b/mds/code/terminal-2.1.0/mds.js @@ -83,7 +83,11 @@ var MDS = { MDS.log("MDS FILEHOST : https://"+host+":"+port+"/"); - MDS.mainhost = "https://"+host+":"+mainport+"/"; + if(port == 0){ + MDS.mainhost = "https://"+host+"/"; + }else{ + MDS.mainhost = "https://"+host+":"+mainport+"/"; + } MDS.log("MDS MAINHOST : "+MDS.mainhost); //Store this for poll messages diff --git a/mds/code/thunder/js/mds.js b/mds/code/thunder/js/mds.js index 3cf076f72..9c1b00430 100644 --- a/mds/code/thunder/js/mds.js +++ b/mds/code/thunder/js/mds.js @@ -75,8 +75,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/timestamp/mds.js b/mds/code/timestamp/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/timestamp/mds.js +++ b/mds/code/timestamp/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/mds/code/vault/mds.js b/mds/code/vault/mds.js index 8c6030de2..e98b215f0 100644 --- a/mds/code/vault/mds.js +++ b/mds/code/vault/mds.js @@ -69,8 +69,14 @@ var MDS = { MDS.log("No MiniDAPP UID specified.. using test value"); } - MDS.filehost = "https://"+host+":"+port+"/"; - MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + //Are we on a standard port (443/80)? + if(port == 0){ + MDS.filehost = "https://"+host+"/"; + MDS.mainhost = "https://"+host+"/mdscommand_/"; + }else{ + MDS.filehost = "https://"+host+":"+port+"/"; + MDS.mainhost = "https://"+host+":"+port+"/mdscommand_/"; + } MDS.log("MDS HOST : "+MDS.filehost); //Store this for poll messages diff --git a/src/org/minima/system/mds/MDSFileHandler.java b/src/org/minima/system/mds/MDSFileHandler.java index 5b2ea932c..15912ab1c 100644 --- a/src/org/minima/system/mds/MDSFileHandler.java +++ b/src/org/minima/system/mds/MDSFileHandler.java @@ -133,7 +133,13 @@ public void run() { if(start != -1) { String name = input.substring(0,start).trim(); String value = input.substring(start+1).trim(); - + + //Normalize header name to be case-insensitive + //HTTP/1.1 headers are case-insensitive (RFC 7230) + //HTTP/2 mandates lowercase headers (RFC 7540) + //Reverse proxies like Traefik may send lowercase headers + name = normalizeHeaderName(name); + //Put it in the headers allheaders.put(name, value); } @@ -820,4 +826,37 @@ public String loadResouceFile(String zResource) throws IOException { return new String(file, MiniString.MINIMA_CHARSET); } -} + + /** + * Normalize HTTP header names to their canonical form. + * HTTP/1.1 headers are case-insensitive (RFC 7230 Section 3.2), + * and HTTP/2 mandates lowercase headers (RFC 7540 Section 8.1.2). + * + * Reverse proxies (Traefik, nginx, HAProxy) may forward headers + * in lowercase when proxying HTTP/2 to HTTP/1.1 backends. + * This ensures headers like "content-length" are normalized to + * "Content-Length" for consistent internal lookups. + */ + private static String normalizeHeaderName(String name) { + if(name == null || name.isEmpty()) { + return name; + } + + //Convert to canonical HTTP header case: first letter and letter after '-' uppercase + StringBuilder sb = new StringBuilder(name.length()); + boolean capitalizeNext = true; + for(int i = 0; i < name.length(); i++) { + char c = name.charAt(i); + if(c == '-') { + sb.append(c); + capitalizeNext = true; + } else if(capitalizeNext) { + sb.append(Character.toUpperCase(c)); + capitalizeNext = false; + } else { + sb.append(Character.toLowerCase(c)); + } + } + return sb.toString(); + } +}