diff options
author | Stefan Bühler <stbuehler@web.de> | 2012-11-07 14:23:00 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2012-11-07 14:23:00 +0000 |
commit | 9b246c5e0901f40c375dfce7102c7749d0951255 (patch) | |
tree | afc8d4862f065da64f03262169ce3702d8bb0f60 /src/configfile-glue.c | |
parent | d4d1ff36aa69bb3afb21527dda7aad092ee2102d (diff) | |
download | lighttpd-git-9b246c5e0901f40c375dfce7102c7749d0951255.tar.gz |
fix :port handling in $HTTP["host"] checks (fixes #2135. thx liming)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2853 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/configfile-glue.c')
-rw-r--r-- | src/configfile-glue.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/configfile-glue.c b/src/configfile-glue.c index 782eb815..3efa46a8 100644 --- a/src/configfile-glue.c +++ b/src/configfile-glue.c @@ -299,17 +299,13 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat ck_colon = strchr(dc->string->ptr, ':'); val_colon = strchr(l->ptr, ':'); - if (ck_colon == val_colon) { - /* nothing to do with it */ - break; - } - if (ck_colon) { + if (NULL != ck_colon && NULL == val_colon) { /* condition "host:port" but client send "host" */ buffer_copy_string_buffer(srv->cond_check_buf, l); buffer_append_string_len(srv->cond_check_buf, CONST_STR_LEN(":")); buffer_append_long(srv->cond_check_buf, sock_addr_get_port(&(srv_sock->addr))); l = srv->cond_check_buf; - } else if (!ck_colon) { + } else if (NULL != val_colon && NULL == ck_colon) { /* condition "host" but client send "host:port" */ buffer_copy_string_len(srv->cond_check_buf, l->ptr, val_colon - l->ptr); l = srv->cond_check_buf; |