|
|
@@ -13,7 +13,7 @@ network::http::interceptor::~interceptor()
|
|
|
{
|
|
|
|
|
|
}
|
|
|
-size_t network::http::interceptor::add(const std::string& express, std::function<bool(network::http::reqpack* rp)> callback)
|
|
|
+size_t network::http::interceptor::add(const std::string& express, std::function<bool(network::http::reqpack* rp,const std::string&)> callback)
|
|
|
{
|
|
|
network::http::interceptor_info *info = new network::http::interceptor_info;
|
|
|
info->express = std::regex(express.c_str());
|
|
|
@@ -29,7 +29,7 @@ bool network::http::interceptor::trigger(const std::string& url, network::http::
|
|
|
{
|
|
|
auto info = m_array.get(i);
|
|
|
if(std::regex_match(url.c_str(),info->express)){
|
|
|
- bool result = info->callback(rp);
|
|
|
+ bool result = info->callback(rp,info->express_string);
|
|
|
if(result == false){
|
|
|
#if HTTP_INTERCEPTOR_PRINT == 1
|
|
|
ylib::log->warn("["+rp->exec_msec()+" ms] false url:"+url+"\t"+" express:"+info->express_string+" ip:"+rp->request()->remote_ipaddress(true),"interceptor");
|