blob: dd03910ba36996cfad51fedfd3a5d5d1d5ccde48 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "HostURLFilter.hpp"
#include "Logger.hpp"
HostURLFilter::HostURLFilter( const std::set<std::string> hosts )
: m_hosts( hosts )
{
}
bool HostURLFilter::filter( const URL url )
{
string host = url.host( );
bool res = ( m_hosts.find( host ) != m_hosts.end( ) );
LOG( logDEBUG ) << ( res ? "Including " : "Excluding " )
<< "'" << url << "' "
<< "for host '" << host << "'";
return res;
}
REGISTER_MODULE_1( "host_urlfilter", URLFilter, HostURLFilter, const std::set<std::string> )
|