Bugfix query

This commit is contained in:
2020-12-28 15:57:23 +01:00
parent 640f3abc1f
commit 6e8875d528

View File

@ -58,6 +58,9 @@ int uri_init(http_uri *uri, const char *webroot, const char *uri_str, int dir_mo
ssize_t size = strlen(uri_str) + 1; ssize_t size = strlen(uri_str) + 1;
uri->req_path = malloc(size); uri->req_path = malloc(size);
url_decode(uri_str, uri->req_path, &size); url_decode(uri_str, uri->req_path, &size);
if (query != NULL) {
query[-1] = '?';
}
if (strstr(uri->req_path, "/../") != NULL || strstr(uri->req_path, "/./") != NULL) { if (strstr(uri->req_path, "/../") != NULL || strstr(uri->req_path, "/./") != NULL) {
return 2; return 2;
} }