From 28a1d1c271dd722dc36cebc5b61f87d80138dba3 Mon Sep 17 00:00:00 2001 From: RblSb Date: Tue, 12 May 2020 06:07:01 +0300 Subject: Minor improvements --- src/server/HttpServer.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server/HttpServer.hx') diff --git a/src/server/HttpServer.hx b/src/server/HttpServer.hx index 0fc46fd..38cfcfe 100644 --- a/src/server/HttpServer.hx +++ b/src/server/HttpServer.hx @@ -6,7 +6,7 @@ import haxe.io.Path; import js.node.Fs; import js.node.Https; import js.node.Http; -import js.node.Url; +import js.node.url.URL; import js.node.http.IncomingMessage; import js.node.http.ServerResponse; import js.node.Path as JsPath; @@ -136,12 +136,12 @@ class HttpServer { static function proxyUrl(req:IncomingMessage, res:ServerResponse):Bool { final url = req.url.replace("/proxy?url=", ""); - final url = Url.parse(js.Node.global.decodeURI(url)); + final url = new URL(js.Node.global.decodeURI(url)); if (url.host == req.headers["host"]) return false; final options = { host: url.host, port: Std.parseInt(url.port), - path: url.path, + path: url.pathname + url.search, method: req.method, // headers: req.headers }; -- cgit v1.2.3