diff mbox series

[09/21] mongoose: Replace deprecated mg_http_match_uri() with mg_match()

Message ID 20240615191941.40301-10-Michael.Glembotzki@iris-sensing.com
State Changes Requested
Headers show
Series Update Mongoose to 7.14 | expand

Commit Message

Michael Glembotzki June 15, 2024, 7:11 p.m. UTC
mongoose rev-id: a025577b30be2fe0a90358702b41b7d8e5afe69f

Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com>
---
 mongoose/mongoose_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/mongoose/mongoose_interface.c b/mongoose/mongoose_interface.c
index b3ebc62f..ba2e8d35 100644
--- a/mongoose/mongoose_interface.c
+++ b/mongoose/mongoose_interface.c
@@ -692,7 +692,7 @@  static void ev_handler(struct mg_connection *nc, int ev, void *ev_data)
 			mg_http_send_digest_auth_request(nc, global_auth_domain);
 		else if (mg_http_get_header(hm, "Sec-WebSocket-Key") != NULL)
 			websocket_handler(nc, ev_data);
-		else if (mg_http_match_uri(hm, "/restart"))
+		else if (mg_match(hm->uri, mg_str("/restart"), NULL))
 			restart_handler(nc, ev_data);
 		else
 			mg_http_serve_dir(nc, ev_data, &s_http_server_opts);
@@ -700,7 +700,7 @@  static void ev_handler(struct mg_connection *nc, int ev, void *ev_data)
 		struct mg_http_message hm;
 		int hlen = mg_http_parse((char *) nc->recv.buf, nc->recv.len, &hm);
 		if (hlen > 0) {
-			if (mg_http_match_uri(&hm, "/upload")) {
+			if (mg_match(hm.uri, mg_str("/upload"), NULL)) {
 				if (!mg_http_is_authorized(&hm, global_auth_domain, global_auth_file)) {
 					if (nc->pfn != NULL)
 						mg_http_send_digest_auth_request(nc, global_auth_domain);