Skip to content

Adds DNS resolver configuration option for ApacheHttpClient #2834

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

Merged
merged 3 commits into from
Nov 10, 2021

Conversation

cenedhryn
Copy link
Contributor

Motivation and Context

Implements a feature requested in #2627

Description

Allows users to set a custom DNS resolver to be used for the Apache Http Client.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@cenedhryn cenedhryn requested a review from dagnir November 9, 2021 23:23
@@ -0,0 +1,6 @@
{
"category": "AWS SDK for Java v2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is specific to Apache, we should change this to the Apache client

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.

overrideDnsResolver("sad.local.host");
}

private void overrideDnsResolver(String hostName) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hostName looks unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will take a look

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used for the URI a bit further down

@@ -123,4 +126,23 @@ public void credentialProviderCanBeUsedWithProxy() {
.credentialsProvider(Mockito.mock(CredentialsProvider.class))
.build();
}

@Test
public void dnsResolverCanBeUsed() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a test that if the caller explicitly sets to null we use the default resolver?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@cenedhryn cenedhryn force-pushed the salande/dns-resolver-override branch from 12227be to bd68a87 Compare November 10, 2021 01:11
@cenedhryn cenedhryn requested a review from a team as a code owner November 10, 2021 01:11
@cenedhryn cenedhryn merged commit f8a440c into master Nov 10, 2021
@cenedhryn cenedhryn deleted the salande/dns-resolver-override branch November 10, 2021 19:01
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

60.0% 60.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants