Skip to content

Commit

Permalink
Make it compile, lowercase methods
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Dec 26, 2019
1 parent d3b43e3 commit 6d1a6ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ struct TemplatedApp {
webSocketContext->getExt()->idleTimeout = behavior.idleTimeout;
webSocketContext->getExt()->maxBackpressure = behavior.maxBackpressure;

return std::move(get(pattern, [webSocketContext, httpContext = this->httpContext, behavior = std::move(behavior)](auto *res, auto *req) mutable {
httpContext->onHttp("get", pattern, [webSocketContext, httpContext = this->httpContext, behavior = std::move(behavior)](auto *res, auto *req) mutable {

/* If we have this header set, it's a websocket */
std::string_view secWebSocketKey = req->getHeader("sec-websocket-key");
Expand Down Expand Up @@ -248,11 +248,12 @@ struct TemplatedApp {
/* Tell the router that we did not handle this request */
req->setYield(true);
}
}, true));
}, true);
return std::move(*this);
}

TemplatedApp &&get(std::string pattern, fu2::unique_function<void(HttpResponse<SSL> *, HttpRequest *)> &&handler, bool upgrade = false) {
httpContext->onHttp("get", pattern, std::move(handler), upgrade);
TemplatedApp &&get(std::string pattern, fu2::unique_function<void(HttpResponse<SSL> *, HttpRequest *)> &&handler) {
httpContext->onHttp("get", pattern, std::move(handler));
return std::move(*this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/HttpRouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct HttpRouter {

USERDATA userData;

std::vector<std::string> methods = {"GET", "POST", "HEAD", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"};
std::vector<std::string> methods = {"get", "post", "head", "put", "delete", "connect", "options", "trace", "patch"};

/* 32-bit */
const static uint32_t HANDLER_MASK = 0x0fffffff;
Expand Down

0 comments on commit 6d1a6ba

Please sign in to comment.