Remove the optional port info from SERVER_NAME (thx Mr_Bond)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2431 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
parent
ef59a62724
commit
def70d86e9
1
NEWS
1
NEWS
|
@ -12,6 +12,7 @@ NEWS
|
|||
* Allow xattr to overwrite mime type (fixes #1929)
|
||||
* Remove link from errormsg about fastcgi apps (fixes #1942)
|
||||
* Strip trailing dot from "Host:" header
|
||||
* Remove the optional port info from SERVER_NAME (thx Mr_Bond)
|
||||
|
||||
- 1.4.22 - 2009-03-07
|
||||
* Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)
|
||||
|
|
10
src/base.h
10
src/base.h
|
@ -183,11 +183,15 @@ typedef struct {
|
|||
} response;
|
||||
|
||||
typedef struct {
|
||||
buffer *scheme;
|
||||
buffer *scheme; /* scheme without colon or slashes ( "http" or "https" ) */
|
||||
|
||||
/* authority with optional portnumber ("site.name" or "site.name:8080" ) NOTE: without "username:password@" */
|
||||
buffer *authority;
|
||||
|
||||
/* path including leading slash ("/" or "/index.html") - urldecoded, and sanitized ( buffer_path_simplify() && buffer_urldecode_path() ) */
|
||||
buffer *path;
|
||||
buffer *path_raw;
|
||||
buffer *query;
|
||||
buffer *path_raw; /* raw path, as sent from client. no urldecoding or path simplifying */
|
||||
buffer *query; /* querystring ( everything after "?", ie: in "/index.php?foo=1", query is "foo=1" ) */
|
||||
} request_uri;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -794,7 +794,11 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
|
|||
cgi_env_add(&env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
|
||||
|
||||
if (!buffer_is_empty(con->server_name)) {
|
||||
cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
|
||||
size_t len = con->server_name->used - 1;
|
||||
char *colon = strchr(con->server_name->ptr, ':');
|
||||
if (colon) len = colon - con->server_name->ptr;
|
||||
|
||||
cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
|
||||
} else {
|
||||
#ifdef HAVE_IPV6
|
||||
s = inet_ntop(srv_sock->addr.plain.sa_family,
|
||||
|
|
|
@ -1885,7 +1885,11 @@ static int fcgi_create_env(server *srv, handler_ctx *hctx, size_t request_id) {
|
|||
FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION)),con)
|
||||
|
||||
if (con->server_name->used) {
|
||||
FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name)),con)
|
||||
size_t len = con->server_name->used - 1;
|
||||
char *colon = strchr(con->server_name->ptr, ':');
|
||||
if (colon) len = colon - con->server_name->ptr;
|
||||
|
||||
FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len),con)
|
||||
} else {
|
||||
#ifdef HAVE_IPV6
|
||||
s = inet_ntop(srv_sock->addr.plain.sa_family,
|
||||
|
|
|
@ -1464,7 +1464,11 @@ static int scgi_create_env(server *srv, handler_ctx *hctx) {
|
|||
scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_SOFTWARE"), CONST_STR_LEN(PACKAGE_NAME"/"PACKAGE_VERSION));
|
||||
|
||||
if (con->server_name->used) {
|
||||
scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), CONST_BUF_LEN(con->server_name));
|
||||
size_t len = con->server_name->used - 1;
|
||||
char *colon = strchr(con->server_name->ptr, ':');
|
||||
if (colon) len = colon - con->server_name->ptr;
|
||||
|
||||
scgi_env_add(p->scgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
|
||||
} else {
|
||||
#ifdef HAVE_IPV6
|
||||
s = inet_ntop(srv_sock->addr.plain.sa_family,
|
||||
|
|
Loading…
Reference in New Issue