mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-30 12:47:48 +02:00
Added basic webui (layout from l-n-s).
This commit is contained in:
parent
e7350a3af4
commit
719bfbc89b
8 changed files with 512 additions and 16 deletions
|
@ -26,8 +26,13 @@ Request::Request(const std::string& data)
|
|||
std::getline(ss, line);
|
||||
parseRequestLine(line);
|
||||
|
||||
while(std::getline(ss, line))
|
||||
while(std::getline(ss, line) && !boost::trim_copy(line).empty())
|
||||
parseHeaderLine(line);
|
||||
|
||||
if(ss) {
|
||||
const std::string current = ss.str();
|
||||
content = current.substr(ss.tellg());
|
||||
}
|
||||
}
|
||||
|
||||
std::string Request::getMethod() const
|
||||
|
@ -55,6 +60,11 @@ std::string Request::getHeader(const std::string& name) const
|
|||
return headers.at(name);
|
||||
}
|
||||
|
||||
std::string Request::getContent() const
|
||||
{
|
||||
return content;
|
||||
}
|
||||
|
||||
Response::Response(int status, const std::string& content)
|
||||
: status(status), content(content), headers()
|
||||
{
|
||||
|
|
|
@ -31,10 +31,13 @@ public:
|
|||
*/
|
||||
std::string getHeader(const std::string& name) const;
|
||||
|
||||
std::string getContent() const;
|
||||
|
||||
private:
|
||||
std::string method;
|
||||
std::string uri;
|
||||
std::string host;
|
||||
std::string content;
|
||||
int port;
|
||||
std::map<std::string, std::string> headers;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue