commit 6c9e39e916f752250680a56bc2dad229c040af7a
parent 2f292620fba218aa4d57117dadd4182799f25460
Author: Christoph Lohmann <20h@r-36.net>
Date: Sun, 26 Apr 2020 12:23:19 +0200
Add comment about special cases in request handling.
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/main.c b/main.c
@@ -189,6 +189,18 @@ handlerequest(int sock, char *base, char *ohost, char *port, char *clienth,
return;
}
+ /*
+ * Valid cases in gopher we overwrite here, but could be used for
+ * other geomyidae features:
+ *
+ * request string = "?..." -> "/?..."
+ * request string = "" -> "/"
+ * request string = "somestring" -> "/somestring"
+ *
+ * Be careful, when you consider those special cases to be used
+ * for some feature. You can easily do good and bad.
+ */
+
args = strchr(recvb, '?');
if (args != NULL)
*args++ = '\0';