From abfb21f3a897919604773a2bfa0953f2eac0a39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E6=B1=9D=E6=A3=8B=E8=8C=97?= <505554090@qq.com> Date: Sun, 3 Aug 2025 19:30:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=EF=BC=9A3.1.15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TouchSocketVersion.props | 2 +- src/TouchSocket.Http/Common/HttpBase.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/TouchSocketVersion.props b/TouchSocketVersion.props index 086a5cb69..44a75920c 100644 --- a/TouchSocketVersion.props +++ b/TouchSocketVersion.props @@ -1,7 +1,7 @@  - 3.1.14 + 3.1.15 $(BaseVersion) diff --git a/src/TouchSocket.Http/Common/HttpBase.cs b/src/TouchSocket.Http/Common/HttpBase.cs index 1c28a2c14..de0f89f6e 100644 --- a/src/TouchSocket.Http/Common/HttpBase.cs +++ b/src/TouchSocket.Http/Common/HttpBase.cs @@ -130,11 +130,12 @@ public abstract class HttpBase : IRequestInfo internal bool ParsingHeader(ref TByteBlock byteBlock) where TByteBlock : IByteBlock { - var index = byteBlock.Span.Slice(byteBlock.Position).IndexOf(StringExtension.Default_RNRN_Utf8Span); + var unreadSpan = byteBlock.Span.Slice(byteBlock.Position); + var index = unreadSpan.IndexOf(StringExtension.Default_RNRN_Utf8Span); if (index > 0) { - var headerLength = index - byteBlock.Position + 2; - this.ReadHeaders(byteBlock.Span.Slice(byteBlock.Position, headerLength)); + var headerLength = index + 2; + this.ReadHeaders(unreadSpan.Slice(0, headerLength)); byteBlock.Position += headerLength; byteBlock.Position += 2; return true;