From 86ac86b83f8007df304c2b02fb5457c72b23181e Mon Sep 17 00:00:00 2001 From: Albert S Date: Sat, 9 Oct 2021 00:31:14 +0200 Subject: [PATCH] Response: addHeader(): Pass by value, not reference --- response.cpp | 4 ++-- response.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/response.cpp b/response.cpp index 3458d25..80b2cfc 100644 --- a/response.cpp +++ b/response.cpp @@ -32,12 +32,12 @@ Response::Response(int http_status_code, std::string html) this->html = std::move(html); } -void Response::addHeader(const std::string &key, const std::string &value) +void Response::addHeader(std::string key, std::string value) { this->responseHeaders.insert(std::make_pair(key, value)); } -Response Response::redirectTemporarily(const std::string &url) +Response Response::redirectTemporarily(std::string url) { Response result; result.addHeader("Location", url); diff --git a/response.h b/response.h index 55c639a..61ccf77 100644 --- a/response.h +++ b/response.h @@ -27,8 +27,8 @@ class Response return this->html; } - void addHeader(const std::string &key, const std::string &value); - static Response redirectTemporarily(const std::string &url); + void addHeader(std::string key, std::string value); + static Response redirectTemporarily(std::string url); void setStatus(int status) {