From 8fa6548e4400c107255266428568bb6c423a4d92 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 22 Aug 2021 22:17:32 +0200 Subject: [PATCH] Added a reference map to Request. Also fixed 2 warnings. --- core/http/request.cpp | 5 ++++- core/http/request.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/http/request.cpp b/core/http/request.cpp index e0c85a5..e8c8d9f 100644 --- a/core/http/request.cpp +++ b/core/http/request.cpp @@ -18,6 +18,7 @@ HTTPSession *Request::get_or_create_session() { } const std::string &Request::get_cookie(const std::string &key) { + return ""; } void Request::add_cookie(const ::Cookie &cookie) { @@ -31,7 +32,8 @@ HTTPMethod Request::get_method() const { } const std::string &Request::get_parameter(const std::string &key) const { - return ""; + static std::string str; + return str; } void Request::compile_body() { @@ -112,6 +114,7 @@ void Request::reset() { compiled_body.clear(); data.clear(); + reference_data.clear(); } std::string Request::parser_get_path() { diff --git a/core/http/request.h b/core/http/request.h index 1e55d8f..68712bd 100644 --- a/core/http/request.h +++ b/core/http/request.h @@ -6,6 +6,7 @@ #include #include "core/object.h" +#include "core/reference.h" #include "handler_instance.h" @@ -38,6 +39,7 @@ public: HTTPSession *session; std::map data; + std::map > reference_data; HTTPSession *get_or_create_session();