Skip to content
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

Fixed #480 IP could not resolve IPv6 #635

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

danielmorell
Copy link
Collaborator

Description of the change

This fixes issue #480. It adds an optional config parameter ip_resolve that can be given one of the CURL_IPRESOLVE_* constants. Unless this config parameter is included the SDK will function entirely as before resolving with IPv4. This is not a breaking change.

Note: Unfortunately, the PHP curl extension does not allow the retrieval of the value of this option once set. There is also no clear and consistently testable side effect that could be tested without introducing flaky tests. I tried a couple different methods but was unable to get consistent results. Because of that no new tests have been written.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Related issues

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

@danielmorell danielmorell added the Type: Bug Fix a component so that its behavior aligns with its documentation. label Mar 1, 2024
@danielmorell danielmorell added this to the v4.1.0 milestone Mar 1, 2024
@danielmorell danielmorell requested a review from alif March 1, 2024 18:35
@@ -54,6 +55,10 @@ public function __construct($opts)
if (array_key_exists('ca_cert_path', $opts)) {
$this->caCertPath = $opts['ca_cert_path'];
}
if (array_key_exists('ip_resolve', $opts)
Copy link

Choose a reason for hiding this comment

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

Can we add testing for this scenario?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added some tests to ensure that the value is set. I usually try to avoid testing private properties since they are generally assumed to be safe to refactor. So, I added a comment to the test in case it fails in the future because of some sort of refactoring.

Copy link

Choose a reason for hiding this comment

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

I approved the PR but it looks like tests are failing.

alif
alif previously approved these changes Mar 1, 2024
@danielmorell danielmorell merged commit 2f9eccb into master Mar 1, 2024
18 checks passed
@danielmorell danielmorell deleted the fixed/480-curl-ip-resolve-for-ipv6 branch March 1, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix a component so that its behavior aligns with its documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Usage with IPv6 only (without IPv4)
2 participants