Skip to content

Commit

Permalink
Upd: Add error log for websocket and api requests without partition
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Oct 9, 2024
1 parent 078bd91 commit 120cbf0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/web_server/web_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
}
//check partition
if (get_partition_from_uri(nc, hm, frontend_nc_data) == false) {
MYMPD_LOG_ERROR(NULL, "API request without partition");
break;
}
//body
Expand Down Expand Up @@ -775,6 +776,7 @@ static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
else if (mg_match(hm->uri, mg_str("/ws/*"), NULL)) {
//check partition
if (get_partition_from_uri(nc, hm, frontend_nc_data) == false) {
MYMPD_LOG_ERROR(NULL, "Websocket request without partition");
break;
}
mg_ws_upgrade(nc, hm, NULL);
Expand Down

0 comments on commit 120cbf0

Please sign in to comment.