From nobody@FreeBSD.ORG Fri Nov 19 14:41:37 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 014141572C; Fri, 19 Nov 1999 14:41:25 -0800 (PST)
Message-Id: <19991119224125.014141572C@hub.freebsd.org>
Date: Fri, 19 Nov 1999 14:41:25 -0800 (PST)
From: mike@skew.org
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: ftp(1) needs to send HTTP/1.1 Host: header
X-Send-Pr-Version: www-1.0

>Number:         15000
>Category:       misc
>Synopsis:       ftp(1) needs to send HTTP/1.1 Host: header
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 19 14:50:00 PST 1999
>Closed-Date:    Fri Nov 16 15:28:51 PST 2001
>Last-Modified:  Sat Nov 17 12:10:01 PST 2001
>Originator:     Mike Brown
>Release:        FreeBSD 3.2-RELEASE
>Organization:
>Environment:
FreeBSD chillout.skew.org 3.2-RELEASE FreeBSD 3.2-RELEASE #0: Sat Aug  7 10:25:47 MDT 1999     mike@chillout.skew.org:/usr/src/sys/compile/chillout  i386
>Description:
Section 19.6.1.1 of RFC 2616 (HTTP/1.1) says:

   Given the rate of growth of
   the Web, and the number of servers already deployed, it is extremely
   important that all implementations of HTTP (including updates to
   existing HTTP/1.0 applications) correctly implement these
   requirements:

      - Both clients and servers MUST support the Host request-header.
>How-To-Repeat:
This fails because the HTTP server needs to be told that the desired virtual host is xml.apache.org, not 209.133.83.18:

ftp http://xml.apache.org/dist/LICENSE.txt
>Fix:
I also submitted this patch to the NetBSD GNATS database.

*** fetch.c.orig        Tue Dec 16 01:58:15 1997
--- fetch.c     Fri Nov 19 15:35:49 1999
***************
*** 236,243 ****
                printf("Requesting %s\n", origline);
        else
                printf("Requesting %s (via %s)\n", origline, proxyenv);
!       len = snprintf(buf, sizeof(buf), "GET %s%s HTTP/1.0\r\n\r\n",
!           proxy ? "" : "/", path);
        if (write(s, buf, len) < len) {
                warn("Writing HTTP request");
                goto cleanup_url_get;
--- 236,243 ----
                printf("Requesting %s\n", origline);
        else
                printf("Requesting %s (via %s)\n", origline, proxyenv);
!       len = snprintf(buf, sizeof(buf), "GET %s%s HTTP/1.0\r\nHost: %s\r\n\r\n",
!           proxy ? "" : "/", path, host);
        if (write(s, buf, len) < len) {
                warn("Writing HTTP request");
                goto cleanup_url_get;


>Release-Note:
>Audit-Trail:

From: Mike Brown <mike@skew.org>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: misc/15000: ftp(1) needs to send HTTP/1.1 Host: header
Date: Fri, 19 Nov 1999 16:54:32 -0700 (MST)

 I got a fast response from Luke Mewburn, the FTP guy for NetBSD. 
 Their ftp(1) is 80 patchlevels ahead of FreeBSD's and has many more 
 improvements than just the Host: header. He says:
 
 "I would recommend that FreeBSD imports and tracks
 ftp://ftp.netbsd.org/pub/NetBSD/misc/lukemftp/lukemftp-1.1.tar.gz
 because that is a `self contained' product with various fixes to stuff 
 like libedit and extra libc functions which FreeBSD may not have yet."
 
 You can also look at 
 http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/basesrc/usr.bin/ftp/fetch.c
 to see how far ahead they are with just ftp/fetch.c.
 
 

From: Mike Brown <mike@skew.org>
To: freebsd-gnats-submit@freebsd.org, mike@skew.org
Cc:  
Subject: Re: misc/15000: ftp(1) needs to send HTTP/1.1%
Date: Fri, 26 Nov 1999 11:14:22 -0700 (MST)

 We just moved xml.apache.org, so the example I posted doesn't fail
 anymore. But you get the idea.
 
 
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: dirk 
Responsible-Changed-When: Thu Nov 9 04:30:56 PST 2000 
Responsible-Changed-Why:  
Over to Mr. fetch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=15000 
Responsible-Changed-From-To: des->freebsd-bugs 
Responsible-Changed-By: des 
Responsible-Changed-When: Thu Nov 9 04:41:36 PST 2000 
Responsible-Changed-Why:  
ftp(1) is not fetch(1), and does not use fetch(3). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=15000 
State-Changed-From-To: open->closed 
State-Changed-By: jedgar 
State-Changed-When: Fri Nov 16 15:28:51 PST 2001 
State-Changed-Why:  
o submitter recommends lukemftp for better http support using 
an ftp client (though fetch(1) should also work fine). 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=15000 

From: Dag-Erling Smorgrav <des@ofug.org>
To: <jedgar@FreeBSD.org>
Cc: mike@skew.org, freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/15000: ftp(1) needs to send HTTP/1.1 Host: header
Date: 17 Nov 2001 21:00:24 +0100

 <jedgar@FreeBSD.org> writes:
 > o submitter recommends lukemftp for better http support using
 >   an ftp client (though fetch(1) should also work fine).
 
 Fetch(1) does indeed work fine, and always has - for a suitable
 definition of "always" :-)  As for lukemftp, there is a good chance we
 will switch to it at some point in the not-to-far future.
 
 DES
 -- 
 Dag-Erling Smorgrav - des@ofug.org
>Unformatted:
