From 68c75f248e9b0b4e4930372e2d09f3898de0a21c Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 27 Feb 2019 22:20:31 +0100 Subject: [PATCH] Gopher: reply in gopher mode only if argv[0] starts with slash. As documented but never implemented. --- src/networking.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/networking.c b/src/networking.c index 7479b72a..c08f43e6 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1550,7 +1550,10 @@ void processInputBuffer(client *c) { if (processInlineBuffer(c) != C_OK) break; /* If the Gopher mode and we got zero or one argument, process * the request in Gopher mode. */ - if (server.gopher_enabled && (c->argc == 1 || c->argc == 0)) { + if (server.gopher_enabled && + ((c->argc == 1 && ((char*)(c->argv[0]->ptr))[0] == '/') || + c->argc == 0)) + { processGopherRequest(c); resetClient(c); c->flags |= CLIENT_CLOSE_AFTER_REPLY;