summaryrefslogtreecommitdiff
path: root/src/configfile-glue.c
diff options
context:
space:
mode:
authorstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2012-11-07 14:24:24 +0000
committerstbuehler <stbuehler@152afb58-edef-0310-8abb-c4023f1b3aa9>2012-11-07 14:24:24 +0000
commit13572839be54cf85366b141c3175f7aed14d7188 (patch)
tree27f6d0c9f360ba9bd4d3db6f033223753d821f62 /src/configfile-glue.c
parentde28131afdaf869a6363410c1f2e0cc30a82742b (diff)
downloadlighttpd-13572839be54cf85366b141c3175f7aed14d7188.tar.gz
fix :port handling in $HTTP["host"] checks (fixes #2135. thx liming)
git-svn-id: svn://svn.lighttpd.net/lighttpd/trunk@2854 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/configfile-glue.c')
-rw-r--r--src/configfile-glue.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/configfile-glue.c b/src/configfile-glue.c
index a2ac07ab..8a31e333 100644
--- a/src/configfile-glue.c
+++ b/src/configfile-glue.c
@@ -286,17 +286,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;