From b916b5274a3b292647805ed19a78a930a0370826 Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 3 Sep 2004 00:48:34 +0000 Subject: [PATCH] hack to allow setting the user agent in HTTP darcs-hash:20040903004834-5007d-33222126c0a8b85a59fad53e63ba02a1be938d57.gz --- src/org/ibex/net/HTTP.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/org/ibex/net/HTTP.java b/src/org/ibex/net/HTTP.java index 30de701..c95183c 100644 --- a/src/org/ibex/net/HTTP.java +++ b/src/org/ibex/net/HTTP.java @@ -16,7 +16,9 @@ public class HTTP { public static InetAddress originAddr = null; public static String originHost = null; - + // FIXME: HACK + public static String userAgent = "Ibex"; + // Cookies ////////////////////////////////////////////////////////////////////////////// public static class Cookie { @@ -455,8 +457,9 @@ public class HTTP { } else { pw.print("GET " + path + " HTTP/1.1\r\n"); } - - pw.print("User-Agent: Ibex\r\n"); + + if (cookies != null) pw.print(cookies.getCookieHeader(host, path, ssl)); + pw.print("User-Agent: " + userAgent + "\r\n"); pw.print("Accept-encoding: gzip\r\n"); pw.print("Host: " + (host + (port == 80 ? "" : (":" + port))) + "\r\n"); if (proxied) pw.print("X-RequestOrigin: " + originHost + "\r\n"); -- 1.7.10.4