-
Notifications
You must be signed in to change notification settings - Fork 66
Simple fix to make the useragent not being overridden. #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,9 +65,15 @@ public UrlConnectionHttpClientBuilder setVersion(String version) { | |
} | ||
|
||
public IHttpClient client() { | ||
if (authKey != null && authKey.trim().length() > 0) | ||
userAgent = "OpenShift"; | ||
return new UrlConnectionHttpClient(username, password, userAgent, sslChecks, requestMediaType, | ||
acceptedMediaType, version, authKey, authIV); | ||
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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here sslChecks is passed in - should it not be sufficient to check that for true/false instead of always having to do the useragent checks/munging blindly ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I basically agree on the patch. But the ssl-checks are not related to the auth-keys. The UrlConnection is verifying SSL certificates by default. The flag was meant to provide the ability to turn those checks off |
||
authKey, authIV); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added to allow actually testing the code.