Uploaded image for project: 'OpenShift Java Client'
  1. OpenShift Java Client
  2. OSJC-50

openshift-java-client: client should not hard-code user-agent if you're usign keys

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 2.1.0
    • None
    • None
    • None

      There is also very weird code in the UrlConnectionHttpClientBuilder which holds user-agent building logic. IMHO this logic should be in the rest service, not in the builder since the user-agent should get built correctly even if you create the client directly or use the builder:

      UrlConnectionHttpClientBuilder
      	public IHttpClient client() {
      		if (authKey != null && authKey.trim().length() > 0) {
      			if (userAgent == null) {
      				userAgent = "OpenShift";
      			} else if (!userAgent.startsWith("OpenShift")) {
      				userAgent = "OpenShift-" + userAgent;
      			}
      		}
      		return new UrlConnectionHttpClient(username, password, userAgent,
      				sslChecks, requestMediaType, acceptedMediaType, version,
      				authKey, authIV);
      	}
      
      

              adietish@redhat.com André Dietisheim
              adietish@redhat.com André Dietisheim
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: