Fix const correctness on http Response object
A number of methods in http::Response were not marked const when they
should've been. This is generally not an issue, as most usages of
Response are in a non-const context, but as we start using const
Response objects more, we need to be more careful about const
correctness.
Tested: Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8b31e71b6594d9328f106e1367084db42b783b6c
diff --git a/http/http_response.hpp b/http/http_response.hpp
index 6c842d7..d06c65d 100644
--- a/http/http_response.hpp
+++ b/http/http_response.hpp
@@ -71,7 +71,7 @@
stringResponse->result(v);
}
- boost::beast::http::status result()
+ boost::beast::http::status result() const
{
return stringResponse->result();
}
@@ -81,7 +81,7 @@
return stringResponse->result_int();
}
- std::string_view reason()
+ std::string_view reason() const
{
return stringResponse->reason();
}
@@ -101,7 +101,7 @@
stringResponse->keep_alive(k);
}
- bool keepAlive()
+ bool keepAlive() const
{
return stringResponse->keep_alive();
}
@@ -151,7 +151,7 @@
}
}
- bool isAlive()
+ bool isAlive() const
{
return isAliveHelper && isAliveHelper();
}