Connection.java (userAgent): New static final field.
* gnu/java/net/protocol/http/Connection.java (userAgent): New static final field. (sendRequest): Use new field in user-agent http agent. From-SVN: r83741
This commit is contained in:
parent
f84b6c964e
commit
ce6230c406
@ -1,3 +1,9 @@
|
|||||||
|
2004-06-27 Mark Wielaard <mark@klomp.org>
|
||||||
|
|
||||||
|
* gnu/java/net/protocol/http/Connection.java (userAgent): New static
|
||||||
|
final field.
|
||||||
|
(sendRequest): Use new field in user-agent http agent.
|
||||||
|
|
||||||
2004-06-27 Mark Wielaard <mark@klomp.org>
|
2004-06-27 Mark Wielaard <mark@klomp.org>
|
||||||
|
|
||||||
* java/awt/EventQueue.java (postEvent): Throw NullPointerException
|
* java/awt/EventQueue.java (postEvent): Throw NullPointerException
|
||||||
|
@ -80,6 +80,8 @@ public final class Connection extends HttpURLConnection
|
|||||||
private static boolean proxyInUse = false;
|
private static boolean proxyInUse = false;
|
||||||
private static String proxyHost = null;
|
private static String proxyHost = null;
|
||||||
|
|
||||||
|
private static final String userAgent;
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
// Recognize some networking properties listed at
|
// Recognize some networking properties listed at
|
||||||
@ -101,6 +103,14 @@ public final class Connection extends HttpURLConnection
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userAgent = "gnu-classpath/"
|
||||||
|
+ System.getProperty("gnu.classpath.version")
|
||||||
|
+ " ("
|
||||||
|
+ System.getProperty("gnu.classpath.vm.shortname")
|
||||||
|
+ "/"
|
||||||
|
+ System.getProperty("java.vm.version")
|
||||||
|
+ ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -215,8 +225,7 @@ public final class Connection extends HttpURLConnection
|
|||||||
setRequestProperty ("Connection", "Close");
|
setRequestProperty ("Connection", "Close");
|
||||||
|
|
||||||
if (getRequestProperty ("user-agent") == null)
|
if (getRequestProperty ("user-agent") == null)
|
||||||
setRequestProperty ("user-agent", "gnu-libgcj/"
|
setRequestProperty ("user-agent", userAgent);
|
||||||
+ System.getProperty ("java.vm.version"));
|
|
||||||
|
|
||||||
if (getRequestProperty ("accept") == null)
|
if (getRequestProperty ("accept") == null)
|
||||||
setRequestProperty ("accept", "*/*");
|
setRequestProperty ("accept", "*/*");
|
||||||
|
Loading…
Reference in New Issue
Block a user