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.
This commit is contained in:
Omar Polo 2021-02-01 12:28:30 +00:00
parent 2fafa2d23e
commit 67528c1f82

3
ex.c
View File

@ -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));