Commit ce6230c4 by Mark Wielaard Committed by Mark Wielaard

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
parent f84b6c96
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>
* java/awt/EventQueue.java (postEvent): Throw NullPointerException
when argument is null.
......
......@@ -80,6 +80,8 @@ public final class Connection extends HttpURLConnection
private static boolean proxyInUse = false;
private static String proxyHost = null;
private static final String userAgent;
static
{
// 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");
if (getRequestProperty ("user-agent") == null)
setRequestProperty ("user-agent", "gnu-libgcj/"
+ System.getProperty ("java.vm.version"));
setRequestProperty ("user-agent", userAgent);
if (getRequestProperty ("accept") == null)
setRequestProperty ("accept", "*/*");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment