empty request should works all the time, not only when in virtualhost

This commit is contained in:
Solene Rapenne 2021-02-27 19:59:28 +01:00
parent fbacb35170
commit 7b0686bdfa

6
main.c
View file

@ -435,10 +435,10 @@ main(int argc, char **argv)
* hostname directory gemini://foobar/hello will look for
* chroot_path/foobar/hello
*/
if (strlen(uri) == 0) {
estrlcpy(uri, "/index.gmi", sizeof(uri));
}
if (virtualhost) {
if (strlen(uri) == 0) {
estrlcpy(uri, "/index.gmi", sizeof(uri));
}
char tmp[PATH_MAX] = {'\0'};
estrlcpy(tmp, hostname, sizeof(tmp));
estrlcat(tmp, uri, sizeof(tmp));