diff options
| author | Mark Wielaard <mark@klomp.org> | 2004-06-27 19:37:08 +0000 |
|---|---|---|
| committer | Mark Wielaard <mark@klomp.org> | 2004-06-27 19:37:08 +0000 |
| commit | d6d1c17b69fc31c7bd738ee175974ab939e2785f (patch) | |
| tree | ed5b561f74d8ce8756d229fa65094c548657ec65 /gnu/java/net | |
| parent | df7c33d3e649116b9d279363e83a610481d6d113 (diff) | |
| download | classpath-d6d1c17b69fc31c7bd738ee175974ab939e2785f.tar.gz | |
* gnu/java/net/protocol/http/Connection.java (userAgent): New static
final field.
(sendRequest): Use new field in user-agent http agent.
Diffstat (limited to 'gnu/java/net')
| -rw-r--r-- | gnu/java/net/protocol/http/Connection.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gnu/java/net/protocol/http/Connection.java b/gnu/java/net/protocol/http/Connection.java index 6f6064acc..44239e172 100644 --- a/gnu/java/net/protocol/http/Connection.java +++ b/gnu/java/net/protocol/http/Connection.java @@ -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-classpath/" - + System.getProperty ("classpath.version")); + setRequestProperty ("user-agent", userAgent); if (getRequestProperty ("accept") == null) setRequestProperty ("accept", "*/*"); |
