@Override public String getUserAgent() { return getStringOpt(USER_AGENT_CONFIG).orElse(defaultUserAgent()); }
public void testDefaultUserAgent() { Assert.assertEquals(AsyncHttpClientConfigDefaults.defaultUserAgent(), "AHC/2.1"); testStringSystemProperty("userAgent", "defaultUserAgent", "MyAHC"); }
private static String getUserAgent(String sonarQubeVersion) { PluginInfo info = StashPluginUtils.getPluginInfo(); String name; String version; name = version = "unknown"; if (info != null) { name = info.getName(); version = info.getVersion(); } return MessageFormat.format("SonarQube/{0} {1}/{2} {3}", sonarQubeVersion == null ? "unknown" : sonarQubeVersion, name, version, AsyncHttpClientConfigDefaults.defaultUserAgent()); }
void configureDefaults() { maxConnections = defaultMaxConnections(); maxConnectionsPerHost = defaultMaxConnectionsPerHost(); name = defaultName(); connectTimeout = defaultConnectTimeout(); webSocketTimeout = defaultWebSocketTimeout(); pooledConnectionIdleTimeout = defaultPooledConnectionIdleTimeout(); readTimeout = defaultReadTimeout(); requestTimeout = defaultRequestTimeout(); connectionTTL = defaultConnectionTTL(); followRedirect = defaultFollowRedirect(); maxRedirects = defaultMaxRedirects(); compressionEnforced = defaultCompressionEnforced(); userAgent = defaultUserAgent(); allowPoolingConnections = defaultAllowPoolingConnections(); maxRequestRetry = defaultMaxRequestRetry(); ioThreadMultiplier = defaultIoThreadMultiplier(); allowPoolingSslConnections = defaultAllowPoolingSslConnections(); disableUrlEncodingForBoundRequests = defaultDisableUrlEncodingForBoundRequests(); strict302Handling = defaultStrict302Handling(); acceptAnyCertificate = defaultAcceptAnyCertificate(); sslSessionCacheSize = defaultSslSessionCacheSize(); sslSessionTimeout = defaultSslSessionTimeout(); if (defaultUseProxySelector()) { proxyServerSelector = ProxyUtils.getJdkDefaultProxyServerSelector(); } else if (defaultUseProxyProperties()) { proxyServerSelector = ProxyUtils.createProxyServerSelector(System.getProperties()); } }