]> sjero.net Git - wget/blobdiff - src/cookies.c
[svn] Specify exact domain match on cookies that don't specify domain.
[wget] / src / cookies.c
index 599d2daa577ccab76d259baea10378203b9de3f4..a88aa2adb2a93441d5f6d47d88007f15e3fe5f85 100644 (file)
@@ -848,8 +848,13 @@ cookie_handle_set_cookie (struct cookie_jar *jar,
   if (!cookie->domain)
     {
     copy_domain:
+      /* If the domain was not provided, we use the one we're talking
+        to, and set exact match.  */
       cookie->domain = xstrdup (host);
-      cookie->port = port;
+      cookie->domain_exact = 1;
+      /* Set the port, but only if it's non-default. */
+      if (port != 80 && port != 443)
+       cookie->port = port;
     }
   else
     {