hack to allow setting the user agent in HTTP
[org.ibex.net.git] / src / org / ibex / net / HTTP.java
index 30de701..c95183c 100644 (file)
@@ -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");