| Date: Sun, 26 Apr 2020 12:23:19 +0200
Add comment about special cases in request handling.
Diffstat:
main.c | 12 ++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)
--- |
| t@@ -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'; |