From f9e39fdd1d2cb85f3d170edfcb1ab0a1c77e2aae Mon Sep 17 00:00:00 2001 From: noisyfox Date: Sat, 3 Dec 2016 18:57:26 +1100 Subject: [PATCH] Refine header parse --- shadowsocks-csharp/Controller/Service/Http2Socks5.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/shadowsocks-csharp/Controller/Service/Http2Socks5.cs b/shadowsocks-csharp/Controller/Service/Http2Socks5.cs index 46d68b73..094ab104 100644 --- a/shadowsocks-csharp/Controller/Service/Http2Socks5.cs +++ b/shadowsocks-csharp/Controller/Service/Http2Socks5.cs @@ -387,6 +387,11 @@ namespace Shadowsocks.Controller.Service Logging.Debug(line); + if (!line.StartsWith("Proxy-")) + { + _headers.Enqueue(line); + } + if (_requestLineCount == 0) { var m = HttpRequestHeaderRegex.Match(line); @@ -413,21 +418,14 @@ namespace Shadowsocks.Controller.Service _targetPort = 80; } } - - _headers.Enqueue(line); } } else { if (line.IsNullOrEmpty()) { - _headers.Enqueue(""); return true; } - if (!line.StartsWith("Proxy-")) - { - _headers.Enqueue(line); - } if (!_isConnect) {