mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
remove http_match_uri()
This commit is contained in:
1 parent
e6bf658271
commit
ef61d6ea48
34 files changed
+83
-93
No files matched your search
@@ -58,11 +58,11 @@ static void fn2(struct mg_connection *c, int ev, void *ev_data) {
|
||||
static void fn(struct mg_connection *c, int ev, void *ev_data) {
|
||||
if (ev == MG_EV_HTTP_MSG) {
|
||||
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
|
||||
if (mg_http_match_uri(hm, "/api/debug")) {
|
||||
if (mg_match(hm->uri, mg_str("/api/debug"), NULL)) {
|
||||
int level = mg_json_get_long(hm->body, "$.level", MG_LL_DEBUG);
|
||||
mg_log_set(level);
|
||||
mg_http_reply(c, 200, "", "Debug level set to %d\n", level);
|
||||
} else if (mg_http_match_uri(hm, "/api/url")) {
|
||||
} else if (mg_match(hm->uri, mg_str("/api/url"), NULL)) {
|
||||
char *url = mg_json_get_str(hm->body, "$.url");
|
||||
if (url == NULL) {
|
||||
mg_http_reply(c, 200, NULL, "no url, rl %d\r\n", (int) c->recv.len);
|
||||
|
||||
Reference in new issue
Block a user