Make WordPress Core

Opened 2 weeks ago

Closed 12 days ago

Last modified 12 days ago

#62303 closed defect (bug) (fixed)

Use better domain for HTTP API invalid hostname test

Reported by: sippis's profile sippis Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.7 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests commit dev-reviewed
Focuses: Cc:

Description

We use example.com as one of the domains to perform HTTP API tests. That domain is owned and operated by IANA so use of it is ok and safe.

We also use exampleeeee.com, which was not registered until this evening. That domain was used to test if IPv4 cannot be resolved. Now that it's registered and has an A-record, it will resolve and fail tests. Instead of using domain(s) that anyone can register, we should use something reliable — for example, caniload.example.org.

https://github.com/WordPress/wordpress-develop/blob/baf408f39e92f55acb0c12f3d052e40c78586bbf/tests/phpunit/tests/http/http.php#L551

https://github.com/WordPress/wordpress-develop/blob/baf408f39e92f55acb0c12f3d052e40c78586bbf/src/wp-includes/http.php#L538

Change History (18)

This ticket was mentioned in PR #7648 on WordPress/wordpress-develop by @sippis.


2 weeks ago
#1

  • Keywords has-patch has-unit-tests added

exampleeeee.com got registered and A-record added so it's not invalid anymore. Example.com is IANA domain and safer to use than some random domain.

Trac ticket: https://core.trac.wordpress.org/ticket/62303

#2 @johnbillion
13 days ago

  • Milestone changed from Awaiting Review to 6.7

Thanks for the ticket and PR Timi. It might be even more preferable to use a .invalid domain, eg example.invalid, as they're guaranteed to never resolve.

".invalid" is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Ref: https://datatracker.ietf.org/doc/html/rfc2606#section-2

#3 @swissspidy
12 days ago

#62307 was marked as a duplicate.

#4 @swissspidy
12 days ago

  • Keywords commit added
  • Severity changed from major to normal

example.invalid sounds reasonable to me.

#5 @MattyRob
12 days ago

Apologies I missed this ticket when I opened the duplicate.

To confirm though the fix is tested and works at ClassicPress PR 1613

#6 @SergeyBiryukov
12 days ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 59293:

Tests: Use better domain for HTTP API invalid hostname test.

The previous domain that was used to test for a host whose IPv4 address cannot be resolved, exampleeeee.com, got registered and has an A-record now, so it's not invalid anymore.

.invalid is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Reference: Reserved Top Level DNS Names: TLDs for Testing, & Documentation Examples.

Follow-up to [52084], [58384], [58388].

Props sippis, johnbillion, MattyRob, swissspidy.
Fixes #62303.

@SergeyBiryukov commented on PR #7648:


12 days ago
#7

Thanks for the PR! Merged in r59293.

#8 @peterwilsoncc
12 days ago

  • Keywords dev-reviewed added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport to 6.7 branch. Marking dev-reviewed as I'm the second committer signing off on the commit.

#9 @peterwilsoncc
12 days ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 59297:

Tests: Use better domain for HTTP API invalid hostname test.

The previous domain that was used to test for a host whose IPv4 address cannot be resolved, exampleeeee.com, got registered and has an A-record now, so it's not invalid anymore.

.invalid is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Reference: Reserved Top Level DNS Names: TLDs for Testing, & Documentation Examples.

Follow-up to [52084], [58384], [58388].

Reviewed by peterwilsoncc.
Merges [59293] to the 6.7 branch.

Props sippis, johnbillion, MattyRob, swissspidy, SergeyBiryukov.
Fixes #62303.

This ticket was mentioned in PR #7654 on WordPress/wordpress-develop by @peterwilsoncc.


12 days ago
#10

Invalid URL should be invalid.

Fixes tests for 6.5 and earlier which doesn't include any src changes.

Trac ticket: Core-62303

#11 @peterwilsoncc
12 days ago

In 59299:

Tests: Use better domain for HTTP API invalid hostname test.

The previous domain that was used to test for a host whose IPv4 address cannot be resolved, exampleeeee.com, got registered and has an A-record now, so it's not invalid anymore.

.invalid is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Reference: Reserved Top Level DNS Names: TLDs for Testing, & Documentation Examples.

Follow-up to [52084], [58384], [58388].

Reviewed by peterwilsoncc.
Merges test changes from [59293] to the 6.5 branch.

Props sippis, johnbillion, MattyRob, swissspidy, SergeyBiryukov.
Fixes #62303.

#12 @peterwilsoncc
12 days ago

In 59300:

Tests: Use better domain for HTTP API invalid hostname test.

The previous domain that was used to test for a host whose IPv4 address cannot be resolved, exampleeeee.com, got registered and has an A-record now, so it's not invalid anymore.

.invalid is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Reference: Reserved Top Level DNS Names: TLDs for Testing, & Documentation Examples.

Follow-up to [52084], [58384], [58388].

Props sippis, johnbillion, MattyRob, swissspidy.
Fixes #62303.

Reviewed by
Merges [59293] to the 6.4 branch.

#13 @peterwilsoncc
12 days ago

In 59301:

Tests: Use better domain for HTTP API invalid hostname test.

The previous domain that was used to test for a host whose IPv4 address cannot be resolved, exampleeeee.com, got registered and has an A-record now, so it's not invalid anymore.

.invalid is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Reference: Reserved Top Level DNS Names: TLDs for Testing, & Documentation Examples.

Follow-up to [52084], [58384], [58388].

Props sippis, johnbillion, MattyRob, swissspidy.
Fixes #62303.

Reviewed by
Merges [59293] to the 6.3 branch.

#14 @peterwilsoncc
12 days ago

In 59302:

Tests: Use better domain for HTTP API invalid hostname test.

The previous domain that was used to test for a host whose IPv4 address cannot be resolved, exampleeeee.com, got registered and has an A-record now, so it's not invalid anymore.

.invalid is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Reference: Reserved Top Level DNS Names: TLDs for Testing, & Documentation Examples.

Follow-up to [52084], [58384], [58388].

Reviewed by peterwilsoncc.
Merges test changes from [59293] to the 6.2 branch.

Props sippis, johnbillion, MattyRob, swissspidy, SergeyBiryukov.
Fixes #62303.

#15 @peterwilsoncc
12 days ago

In 59303:

Tests: Use better domain for HTTP API invalid hostname test.

The previous domain that was used to test for a host whose IPv4 address cannot be resolved, exampleeeee.com, got registered and has an A-record now, so it's not invalid anymore.

.invalid is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Reference: Reserved Top Level DNS Names: TLDs for Testing, & Documentation Examples.

Follow-up to [52084], [58384], [58388].

Reviewed by peterwilsoncc.
Merges test changes from [59293] to the 6.1 branch.

Props sippis, johnbillion, MattyRob, swissspidy, SergeyBiryukov.
Fixes #62303.

#16 @peterwilsoncc
12 days ago

In 59304:

Tests: Use better domain for HTTP API invalid hostname test.

The previous domain that was used to test for a host whose IPv4 address cannot be resolved, exampleeeee.com, got registered and has an A-record now, so it's not invalid anymore.

.invalid is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Reference: Reserved Top Level DNS Names: TLDs for Testing, & Documentation Examples.

Follow-up to [52084], [58384], [58388].

Reviewed by peterwilsoncc.
Merges test changes from [59293] to the 6.0 branch.

Props sippis, johnbillion, MattyRob, swissspidy, SergeyBiryukov.
Fixes #62303.

#17 @peterwilsoncc
12 days ago

In 59305:

Tests: Use better domain for HTTP API invalid hostname test.

The previous domain that was used to test for a host whose IPv4 address cannot be resolved, exampleeeee.com, got registered and has an A-record now, so it's not invalid anymore.

.invalid is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.

Reference: Reserved Top Level DNS Names: TLDs for Testing, & Documentation Examples.

Follow-up to [52084], [58384], [58388].

Reviewed by peterwilsoncc.
Merges test changes from [59293] to the 5.9 branch.

Props sippis, johnbillion, MattyRob, swissspidy, SergeyBiryukov.
Fixes #62303.

Note: See TracTickets for help on using tickets.