summaryrefslogtreecommitdiff
path: root/PlexReqHandlerFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'PlexReqHandlerFactory.cpp')
-rw-r--r--PlexReqHandlerFactory.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/PlexReqHandlerFactory.cpp b/PlexReqHandlerFactory.cpp
index dacdff7..c1d9401 100644
--- a/PlexReqHandlerFactory.cpp
+++ b/PlexReqHandlerFactory.cpp
@@ -1,18 +1,15 @@
#include "PlexReqHandlerFactory.h"
-namespace plexclient
-{
+namespace plexclient {
-PlexReqHandlerFactory::PlexReqHandlerFactory()
-{
-}
+ PlexReqHandlerFactory::PlexReqHandlerFactory() {
+ }
-PlexReqHandlerFactory::~PlexReqHandlerFactory()
-{
-}
+ PlexReqHandlerFactory::~PlexReqHandlerFactory() {
+ }
-Poco::Net::HTTPRequestHandler* PlexReqHandlerFactory::createRequestHandler(const Poco::Net::HTTPServerRequest& request)
-{ /*
+ Poco::Net::HTTPRequestHandler *PlexReqHandlerFactory::createRequestHandler(
+ const Poco::Net::HTTPServerRequest &request) { /*
if(request.getMethod() == Poco::Net::HTTPRequest::HTTP_GET) {
std::cout << "GET Request: " << request.getURI() << " from: " << request.clientAddress().toString() << std::endl;
} else if(request.getMethod() == Poco::Net::HTTPRequest::HTTP_OPTIONS) {
@@ -24,11 +21,11 @@ Poco::Net::HTTPRequestHandler* PlexReqHandlerFactory::createRequestHandler(const
std::cout << "??? Request: " << request.getURI() << " from: " << request.clientAddress().toString() << std::endl;
}
*/
- if(request.getURI().find("/player/timeline")!= std::string::npos) return new SubscribeRequestHandler();
- else if(request.getURI().find("/resources")!= std::string::npos) return new ResourceRequestHandler();
- else if(request.getURI().find("/player")!= std::string::npos) return new PlayerRequestHandler();
+ if (request.getURI().find("/player/timeline") != std::string::npos) return new SubscribeRequestHandler();
+ else if (request.getURI().find("/resources") != std::string::npos) return new ResourceRequestHandler();
+ else if (request.getURI().find("/player") != std::string::npos) return new PlayerRequestHandler();
- return new PlexHTTPRequestHandler();
-}
+ return new PlexHTTPRequestHandler();
+ }
}