浏览代码

Allow CORS preflight only if simple CORS is allowed as well

bel2125 8 年之前
父节点
当前提交
cceaa463eb
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -11486,9 +11486,9 @@ handle_request(struct mg_connection *conn)
 
 
 		/* Todo: check if cors_origin is in cors_orig_cfg.
 		/* Todo: check if cors_origin is in cors_orig_cfg.
 		 * Or, let the client check this. */
 		 * Or, let the client check this. */
-		(void)cors_origin;
 
 
 		if ((cors_meth_cfg != NULL) && (*cors_meth_cfg != 0)
 		if ((cors_meth_cfg != NULL) && (*cors_meth_cfg != 0)
+		    && (cors_orig_cfg != NULL) && (*cors_orig_cfg != 0)
 		    && (cors_origin != NULL) && (cors_acrm != NULL)) {
 		    && (cors_origin != NULL) && (cors_acrm != NULL)) {
 			/* This is a valid CORS preflight, and the server is configured to
 			/* This is a valid CORS preflight, and the server is configured to
 			 * handle it automatically. */
 			 * handle it automatically. */