Welcome! Log In Create A New Profile

Advanced

Fix the incorrect value of $host when IPv6 in Host header

August 31, 2011 03:48AM
This is the diff to fix the problem of
http://forum.nginx.org/read.php?2,214541

Can this be integrated into main branch? Thanks.


--- ngx_http_request.c 2011-08-24 05:21:59.354049000 -0700
+++ ngx_http_request.c.backup 2011-08-24 05:05:33.244048997 -0700
@@ -1658,20 +1658,10 @@
size_t i, last;
ngx_uint_t dot;

-#if (NGX_HAVE_INET6)
- ngx_uint_t ipv6 = 0;
-#endif
-
last = len;
h = *host;
dot = 0;

-#if (NGX_HAVE_INET6)
- if (len > 0 && h[0] == '[') {
- ipv6 = 1;
- }
-#endif
-
for (i = 0; i < len; i++) {
ch = h[i];

@@ -1687,13 +1677,7 @@
dot = 0;

if (ch == ':') {
-#if (NGX_HAVE_INET6)
- if (!ipv6) {
- last = i;
- }
-#else
last = i;
-#endif
continue;
}

@@ -1704,11 +1688,6 @@
if (ch >= 'A' || ch < 'Z') {
alloc = 1;
}
-#if (NGX_HAVE_INET6)
- if (ch == ']') {
- ipv6 = 0;
- }
-#endif
}

if (dot) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Fix the incorrect value of $host when IPv6 in Host header

speedfirst 2272 August 31, 2011 03:48AM

Re: Fix the incorrect value of $host when IPv6 in Host header

Maxim Dounin 1006 August 31, 2011 05:22AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 191
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready