changeset 3585:cb985ea11ed5

Added the Host field in the HTTP request.
author bertrand
date Tue, 18 Dec 2001 18:45:00 +0000
parents 7c4046c04be3
children a0009a534428
files libmpdemux/network.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/network.c	Tue Dec 18 17:29:27 2001 +0000
+++ b/libmpdemux/network.c	Tue Dec 18 18:45:00 2001 +0000
@@ -154,9 +154,12 @@
 int
 http_send_request( URL_t *url ) {
 	HTTP_header_t *http_hdr;
+	char str[80];
 	int fd;
 	http_hdr = http_new_header();
 	http_set_uri( http_hdr, url->file );
+	snprintf(str, 80, "Host: %s", url->hostname );
+	http_set_field( http_hdr, str);
 	http_set_field( http_hdr, "User-Agent: MPlayer");
 	http_set_field( http_hdr, "Connection: closed");
 	if( http_build_request( http_hdr )==NULL ) {