mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-08-03 12:50:02 +00:00
Fail if CONTENT_TYPE is not application/x-www-form-urlencoded.
As part of the partial improvement to the POST reading code I also added a max_post_size setting which defaults to 1 MiB. POST inputs longer than that size get truncated. This is separate to max_pastie_size, which is just the size of one of the values in the POST data.
This commit is contained in:
parent
24baf67a65
commit
2f00014758
9 changed files with 87 additions and 22 deletions
|
@ -17,11 +17,17 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "tawashi_exception.hpp"
|
||||
#include <boost/container/flat_map.hpp>
|
||||
#include <string>
|
||||
#include <istream>
|
||||
#include <cstddef>
|
||||
|
||||
namespace tawashi {
|
||||
class UnsupportedContentTypeException : public TawashiException {
|
||||
public:
|
||||
explicit UnsupportedContentTypeException (const boost::string_ref& parMessage);
|
||||
};
|
||||
|
||||
namespace cgi {
|
||||
class Env;
|
||||
|
@ -29,5 +35,6 @@ namespace tawashi {
|
|||
typedef boost::container::flat_map<std::string, std::string> PostMapType;
|
||||
|
||||
const PostMapType& read_post (std::istream& parSrc, const Env& parEnv);
|
||||
const PostMapType& read_post (std::istream& parSrc, const Env& parEnv, std::size_t parMaxLen);
|
||||
} //namespace cgi
|
||||
} //namespace tawashi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue