Skip to content

Commit

Permalink
Always including filename when sending a curl mime file
Browse files Browse the repository at this point in the history
  • Loading branch information
COM8 committed Apr 10, 2024
1 parent f128609 commit bacb197
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpr/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "cpr/curlholder.h"
#include "cpr/error.h"
#include "cpr/file.h"
#include "cpr/filesystem.h" // IWYU pragma: keep
#include "cpr/http_version.h"
#include "cpr/interceptor.h"
#include "cpr/interface.h"
Expand Down Expand Up @@ -928,6 +929,9 @@ void Session::prepareBodyPayloadOrMultipart() const {

if (file.hasOverridenFilename()) {
curl_mime_filename(mimePart, file.overriden_filename.c_str());
} else {
// NOLINTNEXTLINE (misc-include-cleaner)
curl_mime_filename(mimePart, std::filesystem::path(file.filepath).filename().c_str());
}
}
} else {
Expand Down

0 comments on commit bacb197

Please sign in to comment.