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

2
main.c
View file

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