diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2016-10-10 13:37:36 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2016-10-10 13:37:36 -0400 |
commit | 7fa5bfc9381764d6c35ac29674bd830e8e5fee33 (patch) | |
tree | 01d11a310146d5d1fcb5fe37d24593bffc12c7ef /src/response.h | |
parent | 81ce160d83792214040fee02497345f34481a3ee (diff) | |
download | lighttpd-git-7fa5bfc9381764d6c35ac29674bd830e8e5fee33.tar.gz |
consistent, shared code to create CGI env
consolidated from CGI, FastCGI, SCGI, SSI
Note: due to prior inconsistencies between the code in mod_cgi,
mod_fastcgi, mod_scgi, and mod_ssi, there are some minor behavior
changes.
CONTENT_LENGTH is now always set, even if 0
(though CONTENT_LENGTH is never set for FASTCGI_AUTHORIZER)
PATH_INFO is created only if present, not if empty.
(mod_fastcgi and mod_ssi previously set PATH_INFO="" (blank value))
PATH_TRANSLATED is now set if PATH_INFO is present
(previously missing from mod_cgi and mod_ssi)
mod_ssi now sets DOCUMENT_ROOT to con->physical.basedir, like others
(previously, mod_ssi set DOCUMENT_ROOT to con->physical.doc_root,
which matched con->physical.basedir unless mod_alias changed basedir)
mod_ssi now sets REQUEST_URI to con->request.orig_uri, like others
(previously, mod_ssi set REQUEST_URI to con->request.uri, which
matched con->request.orig_uri except after redirects, error docs)
Diffstat (limited to 'src/response.h')
-rw-r--r-- | src/response.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/response.h b/src/response.h index 3302f3e2..0fc8bfcd 100644 --- a/src/response.h +++ b/src/response.h @@ -13,6 +13,16 @@ int response_header_insert(server *srv, connection *con, const char *key, size_t int response_header_overwrite(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen); int response_header_append(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen); +typedef struct http_cgi_opts_t { + int authorizer; + int break_scriptfilename_for_php; + buffer *docroot; + buffer *strip_request_uri; +} http_cgi_opts; + +typedef int (*http_cgi_header_append_cb)(void *vdata, const char *k, size_t klen, const char *v, size_t vlen); +int http_cgi_headers(server *srv, connection *con, http_cgi_opts *opts, http_cgi_header_append_cb cb, void *vdata); + handler_t http_response_prepare(server *srv, connection *con); int http_response_redirect_to_directory(server *srv, connection *con); int http_response_handle_cachable(server *srv, connection *con, buffer * mtime); |