From de1f5830ccc00dfa3f51611c021c9763af02b01b Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Tue, 2 Apr 2024 10:12:39 +0200 Subject: [PATCH] fix: send attachments without content-type (#98) --- 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));