diff stream/network.c @ 32995:80e4a267f6b8

Allow setting custom http header. Patch by Nikolay Nikolaev, nicknickolaev yahoo com
author cehoyos
date Thu, 17 Mar 2011 08:58:49 +0000
parents 0d95f044c589
children b4c4ee25269f
line wrap: on
line diff
--- a/stream/network.c	Mon Mar 14 00:07:11 2011 +0000
+++ b/stream/network.c	Thu Mar 17 08:58:49 2011 +0000
@@ -57,6 +57,7 @@
 int   network_cookies_enabled = 0;
 char *network_useragent=NULL;
 char *network_referrer=NULL;
+char **network_http_header_fields=NULL;
 
 /* IPv6 options */
 int   network_ipv4_only_proxy = 0;
@@ -246,6 +247,12 @@
 
 	if (network_cookies_enabled) cookies_set( http_hdr, server_url->hostname, server_url->url );
 
+	if (network_http_header_fields) {
+		int i=0;
+		while (network_http_header_fields[i])
+			http_set_field(http_hdr, network_http_header_fields[i++]);
+	}
+
 	http_set_field( http_hdr, "Connection: close");
 	if (proxy)
 		http_add_basic_proxy_authentication(http_hdr, url->username, url->password);