diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | gmid.c | 7 | ||||
-rw-r--r-- | gmid.h | 1 |
3 files changed, 9 insertions, 0 deletions
@@ -1,6 +1,7 @@ 2021-01-11 Omar Polo <op@omarpolo.com> * gmid.c (main): ipv6 disabled by default and -6 flag to enable it + (handle): reject non-gemini protocols with 53 2021-01-10 Omar Polo <op@omarpolo.com> @@ -600,6 +600,13 @@ handle(struct pollfd *fds, struct client *client) return; } + if (strcmp(iri.schema, "gemini")) { + if (!start_reply(fds, client, PROXY_REFUSED, "won't proxy request")) + return; + goodbye(fds, client); + return; + } + LOGI(client, "GET %s%s%s", *iri.path ? iri.path : "/", *iri.query ? "?" : "", @@ -45,6 +45,7 @@ #define SUCCESS 20 #define TEMP_FAILURE 40 #define NOT_FOUND 51 +#define PROXY_REFUSED 53 #define BAD_REQUEST 59 #define MAX_USERS 64 |