From 67528c1f82bed7d6626c3be7a68d3cd98b4944f5 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Mon, 1 Feb 2021 12:28:30 +0000 Subject: [PATCH] don't add the query to argv FRC3875 says that if the query does not contain any unecnoded "=" characters, we SHOULD treat the query string as a "search-string", split in on "+" and add every word to the CGI argv. In launch_cgi it's too late because iri->query is the *decoded* query! I have in mind some refactoring around how we decode things, so this is postponed. --- ex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ex.c b/ex.c index 2e8e765..fbed2fe 100644 --- a/ex.c +++ b/ex.c @@ -246,7 +246,7 @@ launch_cgi(struct iri *iri, const char *spath, char *relpath, return -1; case 0: { /* child */ - char *argv[] = {NULL, NULL, NULL}; + char *argv[] = {NULL, NULL}; char *ex, *pwd; char iribuf[GEMINI_URL_LEN]; char path[PATH_MAX]; @@ -257,7 +257,6 @@ launch_cgi(struct iri *iri, const char *spath, char *relpath, ex = xasprintf("%s/%s", vhost->dir, spath); argv[0] = ex; - argv[1] = iri->query; serialize_iri(iri, iribuf, sizeof(iribuf));