Skip to content

Commit

Permalink
fixing conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
ekerwin committed Mar 9, 2018
1 parent a74d9f6 commit ab89335
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ public void validateHubUrl(final ValidationResults result) {
try {
final HubServerVerifier hubServerVerifier = new HubServerVerifier(hubURL, proxyInfo, alwaysTrustServerCertificate, NumberUtils.toInt(timeoutSeconds, 120));
hubServerVerifier.verifyIsHubServer();

} catch (final IntegrationRestException e) {
if (e.getHttpStatusCode() == 407) {
result.addResult(ProxyInfoField.PROXYUSERNAME, new ValidationResult(ValidationResultEnum.ERROR, e.getHttpStatusMessage()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,8 @@ protected List<String> getRuleUrls(final List<String> rulesViolated) {
/**
* In Hub versions prior to 3.2, the rule URLs contained in notifications are internal. To match the configured rule URLs, the "internal" segment of the URL from the notification must be removed. This is the workaround recommended by
* Rob P. In Hub 3.2 on, these URLs will exclude the "internal" segment.
*
* @param origRuleUrl
* @return
*/
//TODO ekerwin - can this now be removed as we are only supporting Hub versions >= 4.4.0?
protected String fixRuleUrl(final String origRuleUrl) {
String fixedRuleUrl = origRuleUrl;
if (origRuleUrl.contains("/internal/")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void verifyIsHubServer() throws IntegrationException {
Request request = new Request.Builder(hubURL.toURI().toString()).build();
try (Response response = restConnection.executeRequest(request)) {
} catch (final IntegrationRestException e) {
if (e.getHttpStatusCode() == 401 && e.getHttpStatusCode() == 403) {
if (e.getHttpStatusCode() == 401 || e.getHttpStatusCode() == 403) {
// This could be a Hub server
} else {
throw e;
Expand Down

0 comments on commit ab89335

Please sign in to comment.