fix(esp_http_server): fix ws server subprotocol match

This commit is contained in:
Ashish Sharma
2026-03-02 14:47:27 +08:00
parent 25a17ddda0
commit 7aa56f8d68
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ static bool httpd_ws_get_response_subprotocol(const char *supported_subprotocol,
char *rest = NULL;
char *s = strtok_r(subprotocol, ", ", &rest);
do {
if (strncmp(s, supported_subprotocol, sizeof(subprotocol)) == 0) {
if (strncmp(s, supported_subprotocol, strlen(supported_subprotocol)) == 0) {
ESP_LOGD(TAG, "Requested subprotocol supported: %s", s);
return true;
}