mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Code cleanup
This commit is contained in:
parent
69a28d50f6
commit
151ccba57e
2 changed files with 13 additions and 17 deletions
|
@ -30,7 +30,7 @@ const std::string JSON_DATA = "{\"hello\":\"world\"}";
|
|||
|
||||
const string LARGE_DATA = string(1024 * 1024 * 100, '@'); // 100MB
|
||||
|
||||
MultipartFile& get_file_value(MultipartFiles &files, const char *key) {
|
||||
MultipartFormData& get_file_value(MultipartFormDataMap &files, const char *key) {
|
||||
auto it = files.find(key);
|
||||
if (it != files.end()) { return it->second; }
|
||||
throw std::runtime_error("invalid mulitpart form data name error");
|
||||
|
@ -801,9 +801,9 @@ protected:
|
|||
.Post("/content_receiver",
|
||||
[&](const Request & req, Response &res, const ContentReader &content_reader) {
|
||||
if (req.is_multipart_form_data()) {
|
||||
MultipartFiles files;
|
||||
MultipartFormDataMap files;
|
||||
content_reader(
|
||||
[&](const std::string &name, const MultipartFile &file) {
|
||||
[&](const std::string &name, const MultipartFormData &file) {
|
||||
files.emplace(name, file);
|
||||
return true;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue