diff -urN orig/src/proxy.c ../gaim-1.5.0/src/proxy.c --- orig/src/proxy.c 2005-05-14 15:33:56.000000000 -0400 +++ ../gaim-1.5.0/src/proxy.c 2006-06-22 11:52:04.000000000 -0400 @@ -1898,3 +1898,15 @@ g_thread_init(NULL); #endif } + +/* returns 0 if not using global http proxy, 1 otherwise */ +int gaim_use_global_http_proxy() +{ + return (((gaim_global_proxy_get_info() == GAIM_PROXY_USE_ENVVAR) && + (g_getenv("HTTP_PROXY") || + g_getenv("http_proxy") || + g_getenv("HTTPPROXY"))) + || + ( gaim_global_proxy_get_info() == GAIM_PROXY_HTTP)) ? 1 : 0; +} + diff -urN orig/src/proxy.h ../gaim-1.5.0/src/proxy.h --- orig/src/proxy.h 2005-07-06 16:02:12.000000000 -0400 +++ ../gaim-1.5.0/src/proxy.h 2006-06-22 11:52:04.000000000 -0400 @@ -221,6 +221,10 @@ int gaim_proxy_connect_socks5(GaimProxyInfo *gpi, const char *host, int port, GaimInputFunction func, gpointer data); + +int gaim_use_global_http_proxy(void); + + /*@}*/ #ifdef __cplusplus diff -urN orig/src/util.c ../gaim-1.5.0/src/util.c --- orig/src/util.c 2005-08-11 20:53:33.000000000 -0400 +++ ../gaim-1.5.0/src/util.c 2006-06-22 11:55:56.000000000 -0400 @@ -2700,7 +2700,10 @@ if (!gfud->sentreq) { char buf[1024]; - + int useproxy; + + useproxy = gaim_use_global_http_proxy(); + if (gfud->user_agent) { /* Host header is not forbidden in HTTP/1.0 requests, and HTTP/1.1 @@ -2712,8 +2715,8 @@ "GET %s%s HTTP/%s\r\n" "User-Agent: %s\r\n" "Host: %s\r\n\r\n", - (gfud->full ? "" : "/"), - (gfud->full ? gfud->url : gfud->website.page), + ( (gfud->full && useproxy) ? "" : "/"), + ( (gfud->full && useproxy) ? gfud->url : gfud->website.page), (gfud->http11 ? "1.1" : "1.0"), gfud->user_agent, gfud->website.address); } @@ -2722,8 +2725,8 @@ g_snprintf(buf, sizeof(buf), "GET %s%s HTTP/%s\r\n" "Host: %s\r\n\r\n", - (gfud->full ? "" : "/"), - (gfud->full ? gfud->url : gfud->website.page), + ( (gfud->full && useproxy) ? "" : "/"), + ( (gfud->full && useproxy) ? gfud->url : gfud->website.page), (gfud->http11 ? "1.1" : "1.0"), gfud->website.address); }