Skip to content

Commit

Permalink
fix failing build on hosts with wildcard dns
Browse files Browse the repository at this point in the history
on hosts which have wildcard dns domains in their local domain search
list, builds failed because "nosuch.host" could actually be resolved.

Since ".host" isn't a recommended TLD by RFC2606, we use ".invalid" now.
And since this is not enough to fix the problem, we use now absoulte
domain names (having a '.' at the end)
  • Loading branch information
jennes authored and neolynx committed May 15, 2024
1 parent 5353890 commit 4bc2180
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions http/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (s *DownloaderSuite) TestDownload404(c *C) {
}

func (s *DownloaderSuite) TestDownloadConnectError(c *C) {
c.Assert(s.d.Download(s.ctx, "http://nosuch.host/", s.tempfile.Name()),
c.Assert(s.d.Download(s.ctx, "http://nosuch.host.invalid./", s.tempfile.Name()),
ErrorMatches, ".*no such host")
}

Expand Down Expand Up @@ -150,7 +150,7 @@ func (s *DownloaderSuite) TestGetLength404(c *C) {
}

func (s *DownloaderSuite) TestGetLengthConnectError(c *C) {
_, err := s.d.GetLength(s.ctx, "http://nosuch.host/")
_, err := s.d.GetLength(s.ctx, "http://nosuch.host.invalid./")

c.Assert(err, ErrorMatches, ".*no such host")
}
4 changes: 2 additions & 2 deletions http/grab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (s *GrabDownloaderSuite) TestDownload404(c *C) {
}

func (s *GrabDownloaderSuite) TestDownloadConnectError(c *C) {
c.Assert(s.d.Download(s.ctx, "http://nosuch.host/", s.tempfile.Name()),
c.Assert(s.d.Download(s.ctx, "http://nosuch.host.invalid./", s.tempfile.Name()),
ErrorMatches, ".*no such host")
}

Expand All @@ -130,7 +130,7 @@ func (s *GrabDownloaderSuite) TestGetLength404(c *C) {
}

func (s *GrabDownloaderSuite) TestGetLengthConnectError(c *C) {
_, err := s.d.GetLength(s.ctx, "http://nosuch.host/")
_, err := s.d.GetLength(s.ctx, "http://nosuch.host.invalid./")

c.Assert(err, ErrorMatches, ".*no such host")
}

0 comments on commit 4bc2180

Please sign in to comment.