diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2010-07-29 09:55:54 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2010-07-29 09:55:54 +0000 |
| commit | e8cf60da349b8741403b1413cc4622372f091050 (patch) | |
| tree | 70afe64e26af0f470b50314f9276e54ecd7d2d8b /src | |
| parent | 6b45b065fe5608d9928c3d7efc66a3142df0f104 (diff) | |
| download | nginx-e8cf60da349b8741403b1413cc4622372f091050.tar.gz nginx-e8cf60da349b8741403b1413cc4622372f091050.tar.bz2 | |
allow server_name "" as the first name
Diffstat (limited to 'src')
| -rw-r--r-- | src/http/ngx_http_core_module.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index f7bb55d5e..8f1ab0841 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -3609,23 +3609,16 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ch = value[1].data[0]; if (cscf->server_name.data == NULL) { - if (value[1].len) { - name = value[1]; + name = value[1]; - if (ch == '.') { - name.len--; - name.data++; - } - - cscf->server_name.len = name.len; - cscf->server_name.data = ngx_pstrdup(cf->pool, &name); - if (cscf->server_name.data == NULL) { - return NGX_CONF_ERROR; - } + if (ch == '.') { + name.len--; + name.data++; + } - } else { - ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "the first server name must not be empty"); + cscf->server_name.len = name.len; + cscf->server_name.data = ngx_pstrdup(cf->pool, &name); + if (cscf->server_name.data == NULL) { return NGX_CONF_ERROR; } } |
