commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: Better User-Agent string


From: Mark Wielaard
Subject: FYI: Better User-Agent string
Date: Sun, 27 Jun 2004 21:31:41 +0200

Hi,

2004-06-27  Mark Wielaard  <address@hidden>

       * gnu/java/net/protocol/http/Connection.java (userAgent): New static
       final field.
       (sendRequest): Use new field in user-agent http agent.

I little better user-agent string so libgcj doesn't need to patch this
anymore. Committed.

Cheers,

Mark
Index: gnu/java/net/protocol/http/Connection.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/gnu/java/net/protocol/http/Connection.java,v
retrieving revision 1.16
diff -u -r1.16 Connection.java
--- gnu/java/net/protocol/http/Connection.java  20 Mar 2004 10:50:39 -0000      
1.16
+++ gnu/java/net/protocol/http/Connection.java  27 Jun 2004 19:31:32 -0000
@@ -80,6 +80,8 @@
   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 @@
              }
          }
       }
+
+    userAgent = "gnu-classpath/"
+      + System.getProperty("gnu.classpath.version")
+      + " ("
+      + System.getProperty("gnu.classpath.vm.shortname")
+      + "/"
+      + System.getProperty("java.vm.version")
+      + ")";
   }
 
   /**
@@ -215,8 +225,7 @@
       setRequestProperty ("Connection", "Close");
     
     if (getRequestProperty ("user-agent") == null)
-      setRequestProperty ("user-agent", "gnu-classpath/"
-                          + System.getProperty ("classpath.version"));
+      setRequestProperty ("user-agent", userAgent);
     
     if (getRequestProperty ("accept") == null)
       setRequestProperty ("accept", "*/*");

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]