From 02f631fdb631f3d35a8d7d90d98fe08b61fa63eb Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Wed, 8 Feb 2023 21:35:29 +0100 Subject: [PATCH] Got rid of RequestContext::full_url --- src/server/request_context.cpp | 4 +--- src/server/request_context.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/server/request_context.cpp b/src/server/request_context.cpp index 9ae3de1a2..017521666 100644 --- a/src/server/request_context.cpp +++ b/src/server/request_context.cpp @@ -57,7 +57,6 @@ RequestContext::RequestContext(struct MHD_Connection* connection, const std::string& _method, const std::string& version) : rootLocation(_rootLocation), - full_url(_rootLocation + urlEncode(unrootedUrl)), url(unrootedUrl), method(str2RequestMethod(_method)), version(version), @@ -137,7 +136,6 @@ void RequestContext::print_debug_info() const { printf("\n"); } printf("Parsed : \n"); - printf("full_url: %s\n", full_url.c_str()); printf("url : %s\n", url.c_str()); printf("acceptEncodingGzip : %d\n", acceptEncodingGzip); printf("has_range : %d\n", byteRange_.kind() != ByteRange::NONE); @@ -175,7 +173,7 @@ std::string RequestContext::get_url_part(int number) const { } std::string RequestContext::get_full_url() const { - return full_url; + return rootLocation + urlEncode(url); } std::string RequestContext::get_root_path() const { diff --git a/src/server/request_context.h b/src/server/request_context.h index 03ea271b3..081b699b9 100644 --- a/src/server/request_context.h +++ b/src/server/request_context.h @@ -138,7 +138,6 @@ class RequestContext { private: // data std::string rootLocation; - std::string full_url; std::string url; RequestMethod method; std::string version;