We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2709cb0 + 5b8c0a1 commit 7e41d9fCopy full SHA for 7e41d9f
1 file changed
include/crow/http_request.h
@@ -20,15 +20,16 @@ namespace crow // NOTE: Already documented in "crow/app.h"
20
#endif
21
22
/// Find and return the value associated with the key. (returns an empty string if nothing is found)
23
- template<typename T>
24
- inline const std::string& get_header_value(const T& headers, const std::string& key)
+ inline const std::string& get_header_value(const ci_map& headers, const std::string& key)
25
{
26
- if (headers.count(key))
27
- {
28
- return headers.find(key)->second;
+ static const std::string EMPTY;
+ const auto it = headers.find(key);
+ if (it != headers.end()) {
+ return it->second;
29
+ }
30
+ else {
31
+ return EMPTY;
32
}
- static std::string empty;
- return empty;
33
34
35
/// An HTTP request.
0 commit comments