X Tutup
Skip to content

Commit 4625f65

Browse files
author
Sebastiano Merlino
committed
Enforced constness of headers getters in http_response
1 parent 3696904 commit 4625f65

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/http_response.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ http_response::~http_response()
3939
webserver::unlock_cache_entry(ce);
4040
}
4141

42-
size_t http_response::get_headers(std::map<std::string, std::string, header_comparator>& result)
42+
size_t http_response::get_headers(std::map<std::string, std::string, header_comparator>& result) const
4343
{
4444
result = this->headers;
4545
return result.size();
4646
}
4747

48-
size_t http_response::get_footers(std::map<std::string, std::string, header_comparator>& result)
48+
size_t http_response::get_footers(std::map<std::string, std::string, header_comparator>& result) const
4949
{
5050
result = this->footers;
5151
return result.size();
5252
}
5353

54-
size_t http_response::get_cookies(std::map<std::string, std::string, header_comparator>& result)
54+
size_t http_response::get_cookies(std::map<std::string, std::string, header_comparator>& result) const
5555
{
5656
result = this->cookies;
5757
return result.size();

src/httpserver/http_response.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,17 @@ class http_response
324324
**/
325325
size_t get_headers(
326326
std::map<std::string, std::string, header_comparator>& result
327-
);
327+
) const;
328328
/**
329329
* Method used to get all footers passed with the request.
330330
* @return a map<string,string> containing all footers.
331331
**/
332332
size_t get_footers(
333333
std::map<std::string, std::string, header_comparator>& result
334-
);
334+
) const;
335335
size_t get_cookies(
336336
std::map<std::string, std::string, header_comparator>& result
337-
);
337+
) const;
338338
/**
339339
* Method used to set all headers of the response.
340340
* @param headers The headers key-value map to set for the response.

0 commit comments

Comments
 (0)
X Tutup