浏览代码

is_websocket_request() modified to check for the presence of keyword rather then euqality

Sergey Lyubka 12 年之前
父节点
当前提交
93131417e6
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      mongoose.c

+ 2 - 2
mongoose.c

@@ -3778,8 +3778,8 @@ static int is_websocket_request(const struct mg_connection *conn) {
 
   return host != NULL && upgrade != NULL && connection != NULL &&
     key != NULL && version != NULL &&
-    !mg_strcasecmp(upgrade, "websocket") &&
-    !mg_strcasecmp(connection, "Upgrade");
+    strstr(upgrade, "websocket") != NULL &&
+    strstr(connection, "Upgrade") != NULL;
 }
 #endif // !USE_WEBSOCKET