diff options
author | Omar Polo <op@omarpolo.com> | 2021-10-24 16:34:30 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-10-24 16:34:30 +0000 |
commit | a81dd6cda6c823fd9ab43abbf8722ced47a754a8 (patch) | |
tree | 59c5694814bd87f395309ed1d8baaff780901e92 /log.c | |
parent | 93edd35305508c984cbee45594dfa45808373a61 (diff) |
fix "double slash" in logs
gmid ended up printing two slashes between the hostname and the path
when logging the request IRI.
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)); |