From 100edc370b48ced588e3f7f0e808653a25350173 Mon Sep 17 00:00:00 2001 From: RPRX <63339210+rprx@users.noreply.github.com> Date: Fri, 12 Mar 2021 11:50:59 +0000 Subject: [PATCH] Stop at '?' when reading HTTP PATH before shunting --- proxy/trojan/server.go | 2 +- proxy/vless/inbound/inbound.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/trojan/server.go b/proxy/trojan/server.go index e274b05c..53056307 100644 --- a/proxy/trojan/server.go +++ b/proxy/trojan/server.go @@ -458,7 +458,7 @@ func (s *Server) fallback(ctx context.Context, sid errors.ExportOption, err erro if k == '\r' || k == '\n' { // avoid logging \r or \n break } - if k == ' ' { + if k == '?' || k == ' ' { path = string(firstBytes[i:j]) newError("realPath = " + path).AtInfo().WriteToLog(sid) if pfb[path] == nil { diff --git a/proxy/vless/inbound/inbound.go b/proxy/vless/inbound/inbound.go index 073ff279..73097526 100644 --- a/proxy/vless/inbound/inbound.go +++ b/proxy/vless/inbound/inbound.go @@ -293,7 +293,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i if k == '\r' || k == '\n' { // avoid logging \r or \n break } - if k == ' ' { + if k == '?' || k == ' ' { path = string(firstBytes[i:j]) newError("realPath = " + path).AtInfo().WriteToLog(sid) if pfb[path] == nil {