mirror of
https://github.com/nginx/nginx.git
synced 2025-01-08 07:03:01 -06:00
*) introduce ngx_strchr()
*) test server_name for '/': it's common configuration error when trailing ';' is omitted and a next directive is treated as server_name
This commit is contained in:
parent
10b9894bee
commit
7a5886052f
@ -40,6 +40,7 @@ typedef struct {
|
||||
|
||||
|
||||
#define ngx_strstr(s1, s2) strstr((const char *) s1, (const char *) s2)
|
||||
#define ngx_strchr(s1, c) strchr((const char *) s1, (int) c)
|
||||
#define ngx_strlen(s) strlen((const char *) s)
|
||||
|
||||
|
||||
|
@ -2614,6 +2614,12 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
return NGX_CONF_ERROR;
|
||||
}
|
||||
|
||||
if (ngx_strchr(value[i].data, '/')) {
|
||||
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
||||
"server name \"%V\" has strange symbols",
|
||||
&value[i]);
|
||||
}
|
||||
|
||||
sn = ngx_array_push(&cscf->server_names);
|
||||
if (sn == NULL) {
|
||||
return NGX_CONF_ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user