From 15dc854e941e06c42b6b844eb7ae352581f4416f Mon Sep 17 00:00:00 2001 From: mtdxc Date: Sat, 11 Mar 2023 21:08:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhttp=20multi=20form=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=87=E4=BB=B6=E5=90=8D=E7=9B=B8=E5=85=B3bug(#2293?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HttpBody.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Http/HttpBody.cpp b/src/Http/HttpBody.cpp index 6c63cc2e..faa6a3a0 100644 --- a/src/Http/HttpBody.cpp +++ b/src/Http/HttpBody.cpp @@ -289,11 +289,7 @@ Buffer::Ptr HttpMultiFormBody::readData(size_t size) { } string HttpMultiFormBody::multiFormBodySuffix(const string &boundary) { - string MPboundary = string("--") + boundary; - string endMPboundary = MPboundary + "--"; - _StrPrinter body; - body << "\r\n" << endMPboundary; - return std::move(body); + return "\r\n--" + boundary + "--"; } string HttpMultiFormBody::multiFormContentType(const string &boundary) { @@ -311,7 +307,7 @@ string HttpMultiFormBody::multiFormBodyPrefix(const HttpArgs &args, const string body << MPboundary << "\r\n"; body << "Content-Disposition: form-data; name=\"" << "file" - << "\";filename=\"" << fileName << "\"\r\n"; + << "\"; filename=\"" << fileName << "\"\r\n"; body << "Content-Type: application/octet-stream\r\n\r\n"; return std::move(body); }