add is_i2p

This commit is contained in:
Jeff Becker 2017-02-05 10:09:43 -05:00 committed by Jeff Becker
parent b14d1801f0
commit 1500e805dd
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
2 changed files with 13 additions and 3 deletions

View file

@ -29,7 +29,7 @@ namespace http {
inline bool is_http_method(const std::string & str) {
return std::find(HTTP_METHODS.begin(), HTTP_METHODS.end(), str) != std::end(HTTP_METHODS);
}
void strsplit(const std::string & line, std::vector<std::string> &tokens, char delim, std::size_t limit = 0) {
std::size_t count = 0;
std::stringstream ss(line);
@ -195,6 +195,11 @@ namespace http {
return out;
}
bool URL::is_i2p() const
{
return host.rfind(".i2p") == ( host.size() - 4 );
}
void HTTPMsg::add_header(const char *name, std::string & value, bool replace) {
add_header(name, value.c_str(), replace);
}