commit a9c69469e23f6f2f05cae0ee0bd2b917c315dec2 from: Omar Polo date: Mon Sep 19 17:45:11 2022 UTC ensure SCRIPT_NAME ends with a '/' commit - acc266fe2434a609a469a42800722015029c5cff commit + a9c69469e23f6f2f05cae0ee0bd2b917c315dec2 blob - 01ebf9d6be5336bf7400e641f55519ec4dc5f7d0 blob + 4d2e19d22a42622d146c5e0f90b00249de96293a --- fcgi.c +++ fcgi.c @@ -329,8 +329,16 @@ fcgi_parse_params(struct fcgi *fcgi, struct evbuffer * path[vlen] = '\0'; free(clt->clt_script_name); - if ((clt->clt_script_name = strdup(path)) == NULL) + clt->clt_script_name = NULL; + + if (vlen > 0 && path[vlen - 1] != '/') + asprintf(&clt->clt_script_name, "%s/", path); + else + clt->clt_script_name = strdup(path); + + if (clt->clt_script_name == NULL) return (-1); + log_debug("clt %d: script_name: %s", clt->clt_id, clt->clt_script_name); continue;