Skip to content

Commit 8179eb9

Browse files
committed
Fixing http_listener::support functions which should take std::function by const reference.
1 parent 524d5b4 commit 8179eb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Release/include/cpprest/http_listener.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class http_listener
250250
/// Add a general handler to support all requests.
251251
/// </summary>
252252
/// <param name="handler">Function object to be called for all requests.</param>
253-
void support(std::function<void(http_request)> handler)
253+
void support(const std::function<void(http_request)> &handler)
254254
{
255255
m_impl->m_all_requests = handler;
256256
}
@@ -260,7 +260,7 @@ class http_listener
260260
/// </summary>
261261
/// <param name="method">An HTTP method.</param>
262262
/// <param name="handler">Function object to be called for all requests for the given HTTP method.</param>
263-
void support(const http::method &method, std::function<void(http_request)> handler)
263+
void support(const http::method &method, const std::function<void(http_request)> &handler)
264264
{
265265
m_impl->m_supported_methods[method] = handler;
266266
}

0 commit comments

Comments
 (0)