projects
/
org.ibex.net.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3b6ea42
)
hack to allow setting the user agent in HTTP
author
adam
<adam@megacz.com>
Fri, 3 Sep 2004 00:48:34 +0000
(
00:48
+0000)
committer
adam
<adam@megacz.com>
Fri, 3 Sep 2004 00:48:34 +0000
(
00:48
+0000)
darcs-hash:
20040903004834
-5007d-
33222126c0a8b85a59fad53e63ba02a1be938d57
.gz
src/org/ibex/net/HTTP.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/net/HTTP.java
b/src/org/ibex/net/HTTP.java
index
30de701
..
c95183c
100644
(file)
--- 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;
public static InetAddress originAddr = null;
public static String originHost = null;
-
+ // FIXME: HACK
+ public static String userAgent = "Ibex";
+
// Cookies //////////////////////////////////////////////////////////////////////////////
public static class Cookie {
// Cookies //////////////////////////////////////////////////////////////////////////////
public static class Cookie {
@@
-455,8
+457,9
@@
public class HTTP {
} else {
pw.print("GET " + path + " HTTP/1.1\r\n");
}
} 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");
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");