always send custom list of fcgi parameters

The code in fcgi_req to send the custom params set in the config file was
placed inside the conditional for `tls_peer_cert_provided`, so the custom
parameters would not be sent if a client certificate is not provided.
This commit is contained in:
nytpu 2022-10-29 21:56:50 -06:00 committed by Omar Polo
parent 7b00c8900b
commit 50a8f9107c
1 changed files with 4 additions and 3 deletions

7
fcgi.c
View File

@ -368,6 +368,10 @@ fcgi_req(struct client *c)
fcgi_send_param(c->cgibev, "SERVER_PROTOCOL", "GEMINI");
fcgi_send_param(c->cgibev, "SERVER_SOFTWARE", GMID_VERSION);
TAILQ_FOREACH(p, &c->host->params, envs) {
fcgi_send_param(c->cgibev, p->name, p->value);
}
if (tls_peer_cert_provided(c->ctx)) {
fcgi_send_param(c->cgibev, "AUTH_TYPE", "CERTIFICATE");
fcgi_send_param(c->cgibev, "REMOTE_USER",
@ -395,9 +399,6 @@ fcgi_req(struct client *c)
gmtime_r(&tim, &tminfo));
fcgi_send_param(c->cgibev, "TLS_CLIENT_NOT_AFTER", buf);
TAILQ_FOREACH(p, &c->host->params, envs) {
fcgi_send_param(c->cgibev, p->name, p->value);
}
} else
fcgi_send_param(c->cgibev, "AUTH_TYPE", "");