aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-12-08 21:19:58 +0300
committerRblSb <msrblsb@gmail.com>2020-12-08 21:19:58 +0300
commitac6a6d069b70d19c93f034832630a49f869257fb (patch)
treecb7cbc1c318a3c3261513bc11e4b79f521f054bb
parent6f3dbd657ed0f05768a55ce9dfecca9881c70eea (diff)
Fix proxy urls with ports
closes RblSb/SyncTube-octosubs#1
-rw-r--r--build/server.js17
-rw-r--r--src/server/HttpServer.hx1
2 files changed, 11 insertions, 7 deletions
diff --git a/build/server.js b/build/server.js
index 8504332..4df6b9f 100644
--- a/build/server.js
+++ b/build/server.js
@@ -1,4 +1,4 @@
-// Generated by Haxe 4.1.1
+// Generated by Haxe 4.1.4
(function ($global) { "use strict";
var $estr = function() { return js_Boot.__string_rec(this,''); },$hxEnums = $hxEnums || {},$_;
function $extend(from, fields) {
@@ -3575,6 +3575,9 @@ server_HttpServer.proxyRequest = function(url,req,res,fn) {
if(url1.host == req.headers["host"]) {
return null;
}
+ if(url1.host.indexOf(":") != -1) {
+ url1.host = url1.host.split(":")[0];
+ }
var proxy = (url1.protocol == "https:" ? js_node_Https.request : js_node_Http.request)({ host : url1.host, port : Std.parseInt(url1.port), path : url1.pathname + url1.search, method : req.method},function(proxyReq) {
if(fn(proxyReq)) {
return;
@@ -4169,7 +4172,7 @@ server_Main.prototype = {
if(this.videoList.length == 0) {
return;
}
- if(!((client.group & 2) != 0)) {
+ if((client.group & 2) == 0) {
return;
}
this.videoTimer.setTime(data.pause.time);
@@ -4180,7 +4183,7 @@ server_Main.prototype = {
if(this.videoList.length == 0) {
return;
}
- if(!((client.group & 2) != 0)) {
+ if((client.group & 2) == 0) {
return;
}
this.videoTimer.setTime(data.play.time);
@@ -4240,7 +4243,7 @@ server_Main.prototype = {
if(!this.checkPermission(client,"requestLeader")) {
return;
}
- } else if(!((client.group & 2) != 0) && clientName != "") {
+ } else if((client.group & 2) == 0 && clientName != "") {
if(!this.checkPermission(client,"setLeader")) {
return;
}
@@ -4273,7 +4276,7 @@ server_Main.prototype = {
if(this.videoList.length == 0) {
return;
}
- if(!((client.group & 2) != 0)) {
+ if((client.group & 2) == 0) {
return;
}
this.videoTimer.setRate(data.setRate.rate);
@@ -4283,7 +4286,7 @@ server_Main.prototype = {
if(this.videoList.length == 0) {
return;
}
- if(!((client.group & 2) != 0)) {
+ if((client.group & 2) == 0) {
return;
}
this.videoTimer.setTime(data.setTime.time);
@@ -4614,7 +4617,7 @@ sys_FileSystem.createDirectory = function(path) {
var stat;
try {
stat = js_node_Fs.statSync(path);
- } catch( _g ) {
+ } catch( _g2 ) {
throw _g1;
}
if(!stat.isDirectory()) {
diff --git a/src/server/HttpServer.hx b/src/server/HttpServer.hx
index 5a7c6ee..c81a464 100644
--- a/src/server/HttpServer.hx
+++ b/src/server/HttpServer.hx
@@ -163,6 +163,7 @@ class HttpServer {
new URL(js.Node.global.decodeURI(url));
} catch (e) return null;
if (url.host == req.headers["host"]) return null;
+ if (url.host.contains(":")) url.host = url.host.split(":")[0];
final options = {
host: url.host,
port: Std.parseInt(url.port),
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage