commit - fb6a629e6969c519b2523c343153f9b76e217843
commit + a057e3a49c3d893382b0a6e19348bec3d8a4f819
blob - 4c71d8fa29d684f5d3e1e2e87ad6a972232e6875
blob + 2d1dc86cd84eeabfdb308272bb45fb5b97b0f597
--- fcgi.c
+++ fcgi.c
fcgi_req(struct client *c)
{
char addr[NI_MAXHOST], buf[22];
+ char *qs;
int e;
time_t tim;
struct tm tminfo;
fcgi_send_param(c->cgibev, "SERVER_PROTOCOL", "GEMINI");
fcgi_send_param(c->cgibev, "SERVER_SOFTWARE", GMID_VERSION);
+ if (*c->iri.query != '\0' &&
+ strchr(c->iri.query, '=') == NULL &&
+ (qs = strdup(c->iri.query)) != NULL) {
+ pct_decode_str(qs);
+ fcgi_send_param(c->cgibev, "GEMINI_SEARCH_STRING", qs);
+ free(qs);
+ }
+
TAILQ_FOREACH(p, &c->host->params, envs) {
fcgi_send_param(c->cgibev, p->name, p->value);
}
blob - 6df232052f134e2ecc4640beee6560d5fa7824c8
blob + 34d78f6f05d847959d5ed504cb26ba35d3d62a09
--- gmid.conf.5
+++ gmid.conf.5
The full IRI of the request.
.It Ev GEMINI_URL_PATH
The path of the request.
+.It Ev GEMINI_SEARCH_STRING
+The decoded
+.Ev QUERY_STRING
+if defined in the request and if it doesn't contain any unencoded
+.Sq =
+characters, otherwise unset.
.It Ev PATH_INFO
The portion of the requested path that is derived from the the IRI
path hierarchy following the part that identifies the script itself.
blob - 7414f0288e681cca468f8b6df769bb7616a38e37
blob + 1436314147c63aba701f6220965b2d5d8e1da04c
--- iri.c
+++ iri.c
char *t;
for (t = s; *t; ++t) {
- if (*t == '%' && valid_pct_enc_string(t))
+ if (*t == '+')
+ *t = ' ';
+ else if (*t == '%' && valid_pct_enc_string(t))
pct_decode(t);
}