Explorar el Código

Allow CORS preflight only if simple CORS is allowed as well

bel2125 hace 8 años
padre
commit
cceaa463eb
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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.
 		 * Or, let the client check this. */
-		(void)cors_origin;
 
 		if ((cors_meth_cfg != NULL) && (*cors_meth_cfg != 0)
+		    && (cors_orig_cfg != NULL) && (*cors_orig_cfg != 0)
 		    && (cors_origin != NULL) && (cors_acrm != NULL)) {
 			/* This is a valid CORS preflight, and the server is configured to
 			 * handle it automatically. */