diff --git a/lib/src/HttpAppFramework.cc b/lib/src/HttpAppFramework.cc index bfc72c68..2f312a48 100755 --- a/lib/src/HttpAppFramework.cc +++ b/lib/src/HttpAppFramework.cc @@ -439,7 +439,7 @@ void HttpAppFrameworkImpl::onAsyncRequest(const HttpRequestPtr& req,const std::f _sessionMapPtr->insert(session_id,std::make_shared< Session >(),_sessionTimeout); } } - ((HttpRequestImpl &)req).setSession((*_sessionMapPtr)[session_id]); + (std::dynamic_pointer_cast(req))->setSession((*_sessionMapPtr)[session_id]); } std::string path = req->path();