On 2016-04-17 Tim Baumgard <[email protected]> wrote: > > Below is an updated diff for the man page to address your feedback. I > also included another small diff that fixes the QUERY_STRING variable > when no query string is given. The RFC states: > > The server MUST set this variable; if the Script-URI does not include > a query component, the QUERY_STRING MUST be defined as an empty string > (""). > > (https://tools.ietf.org/html/rfc3875#section-4.1.7) > > nginx follows the RFC, so I'm assuming that httpd's behavior is a > bug. The man page diff takes this change into account.
OK chrisz@, please wait for florian@ or reyk@, too.
> Index: httpd.conf.5
> ===================================================================
> RCS file: /cvs/src/usr.sbin/httpd/httpd.conf.5,v
> retrieving revision 1.68
> diff -u -p -r1.68 httpd.conf.5
> --- httpd.conf.5 19 Jul 2015 05:17:27 -0000 1.68
> +++ httpd.conf.5 18 Apr 2016 01:26:18 -0000
> @@ -274,6 +274,62 @@ root directory of
> .Xr httpd 8
> and defaults to
> .Pa /run/slowcgi.sock .
> +.Pp
> +The FastCGI handler will be given the following variables:
> +.Pp
> +.Bl -tag -width GATEWAY_INTERFACE -offset indent -compact
> +.It Ic DOCUMENT_ROOT
> +The document root in which the script is located as configured by the
> +.Ic root
> +option for the server or location that matches the request.
> +.It Ic GATEWAY_INTERFACE
> +The revision of the CGI specification used.
> +.It Ic HTTP_*
> +Additional HTTP headers the connected client sent in the request, if
> +any.
> +.It Ic HTTPS
> +A variable that is set to
> +.Qq on
> +when the server has been configured to use TLS. This variable is
> +omitted otherwise.
> +.It Ic REQUEST_URI
> +The path and optional query string as requested by the connected
> client. +.It Ic DOCUMENT_URI
> +The canonicalized URI for the script, possibly with a slash or
> +directory index file name appended.
> +.It Ic SCRIPT_NAME
> +The virtual URI path to the script.
> +.It Ic PATH_INFO
> +The optional path appended after the script name in the request path.
> +This variable is an empty string if no path is appended after the
> +script name.
> +.It Ic SCRIPT_FILENAME
> +The absolute, physical path to the script within the
> +.Xr chroot 2
> +directory.
> +.It Ic QUERY_STRING
> +The optional query string of the request. This variable is an empty
> +string if there is no query string in the request.
> +.It Ic REMOTE_ADDR
> +The IP address of the connected client.
> +.It Ic REMOTE_PORT
> +The TCP source port of the connected client.
> +.It Ic REMOTE_USER
> +The remote user when using HTTP authentication.
> +.It Ic REQUEST_METHOD
> +The HTTP method the connected client used when making the request.
> +.It Ic SERVER_ADDR
> +The configured IP address of the server.
> +.It Ic SERVER_NAME
> +The name of the server.
> +.It Ic SERVER_PORT
> +The configured TCP server port of the server.
> +.It Ic SERVER_PROTOCOL
> +The revision of the HTTP specification used.
> +.It Ic SERVER_SOFTWARE
> +The server software name of
> +.Xr httpd 8 .
> +.El
> .It Ic hsts Oo Ar option Oc
> Enable HTTP Strict Transport Security.
> Valid options are:
>
>
> Index: server_fcgi.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/httpd/server_fcgi.c,v
> retrieving revision 1.67
> diff -u -p -r1.67 server_fcgi.c
> --- server_fcgi.c 23 Nov 2015 20:56:15 -0000 1.67
> +++ server_fcgi.c 18 Apr 2016 01:26:49 -0000
> @@ -242,12 +242,16 @@ server_fcgi(struct httpd *env, struct cl
> goto fail;
> }
>
> - if (desc->http_query)
> + if (desc->http_query) {
> if (fcgi_add_param(¶m, "QUERY_STRING",
> desc->http_query, clt) == -1) {
> errstr = "failed to encode param";
> goto fail;
> }
> + } else if (fcgi_add_param(¶m, "QUERY_STRING", "", clt)
> == -1) {
> + errstr = "failed to encode param";
> + goto fail;
> + }
>
> if (fcgi_add_param(¶m, "DOCUMENT_ROOT", srv_conf->root,
> clt) == -1) {
>
--
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
2779 7F73 44FD 0736 B67A C410 69EC 7922 34B4 2566
pgpggwfN2z0vD.pgp
Description: OpenPGP digital signature
