mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
send http headers in original order
This commit is contained in:
parent
7ae38a71cc
commit
66f3bd186f
6 changed files with 113 additions and 66 deletions
15
HTTP.h
15
HTTP.h
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -54,7 +55,8 @@ namespace http {
|
|||
std::string to_string ();
|
||||
};
|
||||
|
||||
struct HTTPMsg {
|
||||
struct HTTPMsg
|
||||
{
|
||||
std::map<std::string, std::string> headers;
|
||||
|
||||
void add_header(const char *name, std::string & value, bool replace = false);
|
||||
|
@ -65,7 +67,9 @@ namespace http {
|
|||
long int content_length();
|
||||
};
|
||||
|
||||
struct HTTPReq : HTTPMsg {
|
||||
struct HTTPReq
|
||||
{
|
||||
std::list<std::pair<std::string, std::string> > headers;
|
||||
std::string version;
|
||||
std::string method;
|
||||
std::string uri;
|
||||
|
@ -82,9 +86,12 @@ namespace http {
|
|||
|
||||
/** @brief Serialize HTTP request to string */
|
||||
std::string to_string();
|
||||
|
||||
void write(std::ostream & o);
|
||||
void write(std::ostream & o);
|
||||
|
||||
void AddHeader (const std::string& name, const std::string& value);
|
||||
void UpdateHeader (const std::string& name, const std::string& value);
|
||||
void RemoveHeader (const std::string& name);
|
||||
std::string GetHeader (const std::string& name) const;
|
||||
};
|
||||
|
||||
struct HTTPRes : HTTPMsg {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue