libcurl is unable to load the cookies when constructing a custom HTTP request over IPv6
Date: Tue, 6 Mar 2012 12:30:13 +0000
We are using libcurl to authenticate to a remote server. In order to do that, we needed to construct a customized HTTP request (including setting our own "Host" header). We were relying on curl to append the cookies received in previous steps to the request. This worked OK on IPv4, but failed on IPv6.
We pinpointed the problem to our custom "Host" header, which was an IPv6 address between  (e.g. "Host: [2001::1]" - just like libcurl was sending for non-custom requests). The cookie domain was determined from this host by removing the part after ':' which was considered the port, leaving us with a host of "[2001", which did not match the domain in the cookie repository.
I'm attaching a bug that solved this problem, and possibly also solves the bug reported by mailsvb in September 2011 (http://curl.haxx.se/mail/archive-2011-09/0022.html ). This patch is made on libcurl 7.24.0.
- application/octet-stream attachment: host_port_fix.patch