fix "double slash" in logs

gmid ended up printing two slashes between the hostname and the path
when logging the request IRI.
This commit is contained in:
Omar Polo 2021-10-24 16:34:30 +00:00
parent 93edd35305
commit a81dd6cda6
1 changed files with 2 additions and 1 deletions

3
log.c
View File

@ -238,7 +238,8 @@ log_request(struct client *c, char *meta, size_t l)
else
strlcat(b, c->iri.host, sizeof(b));
strlcat(b, "/", sizeof(b));
if (*c->iri.path != '/')
strlcat(b, "/", sizeof(b));
strlcat(b, c->iri.path, sizeof(b)); /* TODO: sanitize UTF8 */
if (*c->iri.query != '\0') { /* TODO: sanitize UTF8 */
strlcat(b, "?", sizeof(b));