Explorar o código

Merge pull request #1041 from forworldm/url-fix

fix unmatched URL length
bel2125 %!s(int64=3) %!d(string=hai) anos
pai
achega
24ec88b288
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -14528,7 +14528,7 @@ handle_request(struct mg_connection *conn)
 	}
 
 	/* 12. Directory uris should end with a slash */
-	if (file.stat.is_directory && (uri_len > 0)
+	if (file.stat.is_directory && ((uri_len = (int) strlen(ri->local_uri)) > 0)
 	    && (ri->local_uri[uri_len - 1] != '/')) {
 
 		size_t len = strlen(ri->request_uri);