From 3f8bcc49bbfff0662bcfa59e831b65a5d050c9f0 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 29 Mar 2024 11:20:12 +0100 Subject: [PATCH] fix: send attachments without content-type --- util/net/http_multipart_builder.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/net/http_multipart_builder.cc b/util/net/http_multipart_builder.cc index 83514cb31b..26c297286f 100644 --- a/util/net/http_multipart_builder.cc +++ b/util/net/http_multipart_builder.cc @@ -169,10 +169,15 @@ std::unique_ptr HTTPMultipartBuilder::GetBodyStream() { for (const auto& pair : file_attachments_) { const FileAttachment& attachment = pair.second; std::string header = GetFormDataBoundary(boundary_, pair.first); +#ifdef SENTRY_MODIFIED header += base::StringPrintf("; filename=\"%s\"%s", attachment.filename.c_str(), kCRLF); header += base::StringPrintf("Content-Type: %s%s", attachment.content_type.c_str(), kBoundaryCRLF); +#else + header += base::StringPrintf("; filename=\"%s\"%s", + attachment.filename.c_str(), kBoundaryCRLF); +#endif streams.push_back(new StringHTTPBodyStream(header)); streams.push_back(new FileReaderHTTPBodyStream(attachment.reader));