From ea3e74217344a0ef86089c6d5806d1bb0e55bbe2 Mon Sep 17 00:00:00 2001 From: 821490174 <821490174@qq.com> Date: Sat, 14 Dec 2019 16:30:27 +0800 Subject: [PATCH] POST ==> Http Error 411 --- src/SocksSharp/Proxy/Request/RequestBuilder.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SocksSharp/Proxy/Request/RequestBuilder.cs b/src/SocksSharp/Proxy/Request/RequestBuilder.cs index e4a2d5d..26abf8c 100644 --- a/src/SocksSharp/Proxy/Request/RequestBuilder.cs +++ b/src/SocksSharp/Proxy/Request/RequestBuilder.cs @@ -46,7 +46,14 @@ public byte[] BuildHeaders(bool hasContent) if (hasContent) { var contentHeaders = GetHeaders(request.Content.Headers); - headers = String.Join(newLine, headers, contentHeaders); + if (!string.IsNullOrEmpty(headers)) + { + headers = string.Join(newLine, headers, contentHeaders); + } + else + { + headers = contentHeaders; + } } return ToByteArray(headers + newLine + newLine);