Skip to content

Commit 016f8b4

Browse files
committed
add req.path
1 parent 2c9fe91 commit 016f8b4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tools/server/server-http.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ void server_http_context::get(const std::string & path, server_http_context::han
362362
server_http_res_ptr response = handler(server_http_req{
363363
get_params(req),
364364
get_headers(req),
365+
req.path,
365366
req.body,
366367
req.is_connection_closed
367368
});
@@ -374,6 +375,7 @@ void server_http_context::post(const std::string & path, server_http_context::ha
374375
server_http_res_ptr response = handler(server_http_req{
375376
get_params(req),
376377
get_headers(req),
378+
req.path,
377379
req.body,
378380
req.is_connection_closed
379381
});

tools/server/server-http.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ using server_http_res_ptr = std::unique_ptr<server_http_res>;
3535

3636
struct server_http_req {
3737
std::map<std::string, std::string> params; // path_params + query_params
38-
std::map<std::string, std::string> headers;
38+
std::map<std::string, std::string> headers; // reserved for future use
39+
std::string path; // reserved for future use
3940
std::string body;
4041
const std::function<bool()> & should_stop;
4142

0 commit comments

Comments
 (0)