mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
update the previous commit: use ngx_strlow()
This commit is contained in:
parent
6749e92938
commit
f63a48ce7e
@ -1616,7 +1616,7 @@ static ssize_t
|
|||||||
ngx_http_validate_host(ngx_http_request_t *r, u_char **host, size_t len,
|
ngx_http_validate_host(ngx_http_request_t *r, u_char **host, size_t len,
|
||||||
ngx_uint_t alloc)
|
ngx_uint_t alloc)
|
||||||
{
|
{
|
||||||
u_char *p, *h, ch;
|
u_char *h, ch;
|
||||||
size_t i, last;
|
size_t i, last;
|
||||||
ngx_uint_t dot;
|
ngx_uint_t dot;
|
||||||
|
|
||||||
@ -1657,16 +1657,12 @@ ngx_http_validate_host(ngx_http_request_t *r, u_char **host, size_t len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (alloc) {
|
if (alloc) {
|
||||||
p = ngx_pnalloc(r->pool, last) ;
|
*host = ngx_pnalloc(r->pool, last) ;
|
||||||
if (p == NULL) {
|
if (*host == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
*host = p;
|
ngx_strlow(*host, h, last);
|
||||||
|
|
||||||
for (i = 0; i < last; i++) {
|
|
||||||
*p++ = ngx_tolower(h[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return last;
|
return last;
|
||||||
|
Loading…
Reference in New Issue
Block a user