Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2015-05-16 19:39:45 +0000
committerPascal Rapicault2015-05-16 19:40:52 +0000
commitcb8870aa8e80fa67aa1dc32974ff80240642c520 (patch)
tree706a4634c9078279cc456e7bdf58fd17d4f6ebcf
parent4af77390986d014ab6a6f65de1a8e6dac911a030 (diff)
downloadrt.equinox.p2-cb8870aa8e80fa67aa1dc32974ff80240642c520.tar.gz
rt.equinox.p2-cb8870aa8e80fa67aa1dc32974ff80240642c520.tar.xz
rt.equinox.p2-cb8870aa8e80fa67aa1dc32974ff80240642c520.zip
Bug 467447 - Set more specific user agentI20150519-0030I20150518-2000I20150517-2000
Change-Id: I7d4f29bee9150d08bd07961a31d2db1a29efd5a7 Signed-off-by: Pascal Rapicault <pascal@rapicorp.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java
index 8f07e99d2..52b621d13 100644
--- a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java
+++ b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/FileReader.java
@@ -60,8 +60,14 @@ public final class FileReader extends FileTransferJob implements IFileTransferLi
static {
Map<String, String> extraRequestHeaders = new HashMap<String, String>(1);
String userAgent = System.getProperty("p2.userAgent"); //$NON-NLS-1$
- if (userAgent == null)
- userAgent = "eclipse/p2/mars"; //$NON-NLS-1$
+ if (userAgent == null) {
+ String productId = System.getProperty("eclipse.product", "eclipse"); //$NON-NLS-1$ //$NON-NLS-2$
+ String appId = System.getProperty("eclipse.application", "noApp"); //$NON-NLS-1$ //$NON-NLS-2$
+ String javaSpec = System.getProperty("java.runtime.version", "unknownJava"); //$NON-NLS-1$//$NON-NLS-2$
+ String osName = System.getProperty("org.osgi.framework.os.name", "unknownOS"); //$NON-NLS-1$ //$NON-NLS-2$
+ String osVersion = System.getProperty("org.osgi.framework.os.version", "unknownOSVersion"); //$NON-NLS-1$ //$NON-NLS-2$
+ userAgent = productId + "/mars (" + appId + "; Java " + javaSpec + "; " + osName + ' ' + osVersion + ')'; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
extraRequestHeaders.put("User-Agent", userAgent); //$NON-NLS-1$
options = new HashMap<String, Map<String, String>>(1);
options.put(org.eclipse.ecf.filetransfer.IRetrieveFileTransferOptions.REQUEST_HEADERS, extraRequestHeaders);

Back to the top