mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 06:26:02 -07:00
Added CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH
This commit is contained in:
parent
47044c05a8
commit
4001637beb
1 changed files with 5 additions and 1 deletions
|
@ -74,6 +74,10 @@
|
|||
#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH ((std::numeric_limits<size_t>::max)())
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH
|
||||
#define CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH 8192
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_TCP_NODELAY
|
||||
#define CPPHTTPLIB_TCP_NODELAY false
|
||||
#endif
|
||||
|
@ -5189,7 +5193,7 @@ inline bool Server::read_content(Stream &strm, Request &req, Response &res) {
|
|||
})) {
|
||||
const auto &content_type = req.get_header_value("Content-Type");
|
||||
if (!content_type.find("application/x-www-form-urlencoded")) {
|
||||
if (req.body.size() > CPPHTTPLIB_REQUEST_URI_MAX_LENGTH) {
|
||||
if (req.body.size() > CPPHTTPLIB_FORM_URL_ENCODED_PAYLOAD_MAX_LENGTH) {
|
||||
res.status = 413; // NOTE: should be 414?
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue