Work around a brokenness in the HTTP spec by generating the Host header

for ftp: URLs as well.  This can't possibly be done in the general case,
but since we only claim to support http and ftp, we'll adhere to the
bogus requirement (RFC 2068, s. 14.25) anyway...  >sigh<

Submitted by: =?iso-8859-1?Q?=C5ge_R=F8bekk?= <aagero@aage.priv.no>
This commit is contained in:
Garrett Wollman 1997-07-26 20:18:43 +00:00
parent 1d7adc8bea
commit 12b7829739

View File

@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: http.c,v 1.8 1997/07/26 19:25:56 wollman Exp $
* $Id: http.c,v 1.9 1997/07/26 20:00:05 wollman Exp $
*/
#include <sys/types.h>
@ -247,7 +247,7 @@ out:
return rv;
}
if (strncmp(uri, "http://", 7) == 0) {
if (strncmp(uri, "http://", 7) == 0 || strncmp(uri, "ftp://", 6) == 0) {
char *hosthdr;
slash = strchr(uri + 7, '/');
if (slash == 0) {