Skip to content

Commit fe2d6ab

Browse files
committed
Merge pull request etr#92 from pellucide/master
Bug with large POSTs
2 parents 2b4a289 + c2c9656 commit fe2d6ab

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/httpserver/http_request.hpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,11 @@ class http_request
442442
**/
443443
void set_arg(const std::string& key, const std::string& value)
444444
{
445-
this->args[key] = value;
445+
if (this->args[key].empty()) {
446+
this->args[key] = value;
447+
} else {
448+
this->args[key].append(value);
449+
}
446450
}
447451
/**
448452
* Method used to set an argument value by key.
@@ -452,7 +456,11 @@ class http_request
452456
**/
453457
void set_arg(const char* key, const char* value, size_t size)
454458
{
455-
this->args[key] = std::string(value, size);
459+
if (this->args[key].empty()) {
460+
this->args[key] = std::string(value, size);
461+
} else {
462+
this->args[key].append(value, size);
463+
}
456464
}
457465
/**
458466
* Method used to set the content of the request

0 commit comments

Comments
 (0)