Skip to content

Commit 564bdaf

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 197667b commit 564bdaf

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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)