Commit e9991827 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

The Host: header now includes the port number if not default HTTP

parent d9c41a0f
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -269,9 +269,12 @@ CURLcode http(struct connectdata *conn)
    http->sendit = getFormData(data->httppost, &http->postsize);
  }

  if(!checkheaders(data, "Host:"))
  if(!checkheaders(data, "Host:")) {
    if(data->port != PORT_HTTP)
      data->ptr_host = maprintf("Host: %s:%d\r\n", host, data->port);
    else
      data->ptr_host = maprintf("Host: %s\r\n", host);

  }

  if(!checkheaders(data, "Pragma:"))
    http->p_pragma = "Pragma: no-cache\r\n";