Skip to content

Commit debe592

Browse files
committed
[3.0] Strip FQDN period from the end of the domain
As brought up in #229 we're already treating all domains as absolute, so adding direct support for it is a small bug fix. That said, fully support for search domains requires a different handling of this and will be done in a different PR.
1 parent 967dac8 commit debe592

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
name: PHPUnit (PHP ${{ matrix.php }})
1010
runs-on: ubuntu-24.04
1111
strategy:
12+
fail-fast: false
1213
matrix:
1314
php:
1415
- 8.4
@@ -25,7 +26,7 @@ jobs:
2526
- uses: shivammathur/setup-php@v2
2627
with:
2728
php-version: ${{ matrix.php }}
28-
coverage: xdebug
29+
coverage: ${{ matrix.php < 8.0 && 'xdebug' || 'pcov' }}
2930
ini-file: development
3031
- run: composer install
3132
- run: vendor/bin/phpunit --coverage-text

src/Resolver/Resolver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function resolve($domain)
2828

2929
public function resolveAll($domain, $type)
3030
{
31+
$domain = trim($domain, '.');
3132
$query = new Query($domain, $type, Message::CLASS_IN);
3233

3334
return $this->executor->query(

tests/FunctionalResolverTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ public function testResolveGoogleResolves()
4848
Loop::run();
4949
}
5050

51+
/**
52+
* @group internet
53+
*/
54+
public function testResolveGoogleFQDNResolves()
55+
{
56+
$promise = $this->resolver->resolve('google.com.');
57+
$promise->then($this->expectCallableOnce(), $this->expectCallableNever());
58+
59+
Loop::run();
60+
}
61+
5162
/**
5263
* @group internet
5364
*/

0 commit comments

Comments
 (0)