]> sjero.net Git - wget/blobdiff - src/http.c
[svn] Skip `:port' in the host header if it is the DEFAULT_HTTPS_PORT when
[wget] / src / http.c
index 01316292e78e90681a788a9b1d72fa754823d29a..28743bd3e025377ad2a38077c3772a7ab4bf837e 100644 (file)
@@ -617,7 +617,7 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt)
     {
       logprintf (LOG_VERBOSE, _("Connecting to %s:%hu... "), u->host, u->port);
       err = make_connection (&sock, u->host, u->port);
-               switch (err)
+      switch (err)
        {
        case HOSTERR:
          logputs (LOG_VERBOSE, "\n");
@@ -780,7 +780,11 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt)
 
   /* String of the form :PORT.  Used only for non-standard ports. */
   port_maybe = NULL;
-  if (remport != 80)
+#ifdef HAVE_SSL
+  if (remport != (u->proto == URLHTTPS ? DEFAULT_HTTPS_PORT : DEFAULT_HTTP_PORT) )
+#else
+  if (remport != DEFAULT_HTTP_PORT)
+#endif
     {
       port_maybe = (char *)alloca (numdigit (remport) + 2);
       sprintf (port_maybe, ":%d", remport);