From db8e4ea1aa1ada0c81a3505360add0be328121e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timmy=20Sj=C3=B6stedt?= Date: Sat, 25 Apr 2015 01:10:01 +0200 Subject: [PATCH] Pass HTTP method & path to dispatch() --- rwgame/debug/HttpServer.cpp | 4 ++-- rwgame/debug/HttpServer.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rwgame/debug/HttpServer.cpp b/rwgame/debug/HttpServer.cpp index b106f430..c0efe6ba 100644 --- a/rwgame/debug/HttpServer.cpp +++ b/rwgame/debug/HttpServer.cpp @@ -37,7 +37,7 @@ void HttpServer::run() std::string http_method = regex_match.str(1); std::string http_path = regex_match.str(2); - std::string response = dispatch(); + std::string response = dispatch(http_method, http_path); client.send(response.c_str(), response.size()); } @@ -48,7 +48,7 @@ void HttpServer::run() listener.close(); } -std::string HttpServer::dispatch() +std::string HttpServer::dispatch(std::string method, std::string path) { return "HTTP/1.1 200 OK\n\n

HELLO FROM OPENRW

"; } diff --git a/rwgame/debug/HttpServer.hpp b/rwgame/debug/HttpServer.hpp index 26eca796..a1e9fc95 100644 --- a/rwgame/debug/HttpServer.hpp +++ b/rwgame/debug/HttpServer.hpp @@ -30,5 +30,5 @@ private: RWGame* game; GameWorld* world; - std::string dispatch(); + std::string dispatch(std::string method, std::string path); };