Skip to content

Commit

Permalink
Merge branch 'master' into websocket-readability
Browse files Browse the repository at this point in the history
  • Loading branch information
dranikpg committed Sep 18, 2022
2 parents af4bdac + 33becfb commit 3a33fd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/crow/middlewares/cookie_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ namespace crow
C::handle
context.aaa
App::context : private CookieParser::contetx, ...
App::context : private CookieParser::context, ...
{
jar
Expand Down
6 changes: 3 additions & 3 deletions include/crow/middlewares/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,16 @@ namespace crow
return node->mutex;
}

// Check wheter this session is already present
// Check whether this session is already present
bool exists() { return bool(node); }

// Get a value by key or fallback if it doesn't exist or is of another type
template<typename F>
auto get(const std::string& key, const F& fallback = F())
// This trick lets the mutli_value deduce the return type from the fallback
// This trick lets the multi_value deduce the return type from the fallback
// which allows both:
// context.get<std::string>("key")
// context.get("key", "") -> char[] is transformed into string by mutlivalue
// context.get("key", "") -> char[] is transformed into string by multivalue
// to return a string
-> decltype(std::declval<session::multi_value>().get<F>(std::declval<F>()))
{
Expand Down

0 comments on commit 3a33fd6

Please sign in to comment.