GNOME Bugzilla – Bug 666399
HTTP/1.0 not working with IPV6
Last modified: 2012-02-14 02:42:47 UTC
I am creating a SoupServer using: if6 = soup_address_new_any (SOUP_ADDRESS_FAMILY_IPV6, server->port); server->server = soup_server_new (SOUP_SERVER_INTERFACE, if6, SOUP_SERVER_PORT, server->port, NULL); And then connecting to it using a client that uses HTTP/1.0. (Don't ask, not my choice.) I'm getting Bad Request errors, and I tracked it down to soup-message-server-io.c, in this line: /* No Host header, no AbsoluteUri */ SoupAddress *addr = soup_socket_get_local_address (sock); const char *host = soup_address_get_physical (addr); url = g_strdup_printf ("%s://%s:%d%s", soup_socket_is_ssl (sock) ? "https" : "ht host, soup_address_get_port (addr), req_path); The URL that gets created here is: http://::ffff:10.0.2.23:8080/push This does not get parsed correctly by soup_uri_new(), thus ending in Bad Request. AFAICT, this is a regression created by the g-inet changes. It works correctly with an IPV4-only server. I can see several possible ways/places to fix this, but not sure the best. I'd be happy to create a patch with some direction.
Just noticed this is with 2.32.2. However, I don't see any commits that would affect this.
(In reply to comment #0) > I can see several possible ways/places to fix this, but not sure the best. I'd > be happy to create a patch with some direction. Easiest would probably be to let SoupURI deal with it. Create an empty URI with soup_uri_new(NULL) and then fill it in with soup_uri_set_*() calls; soup_uri_to_string() will put []s around the host if it's an IPv6 literal.
fixed in git