wjdp / htmltest

:white_check_mark: Test generated HTML for problems
MIT License
323 stars 54 forks source link

Ignore link rel preconnect when testing external links #202

Closed ghaydtner closed 1 year ago

ghaydtner commented 1 year ago

Describe the bug

informs the browser that your page intends to establish a connection to another origin, and that you'd like the process to start as soon as possible. As you specifiy the domain only for that other origin, the domain only doesn't always return status 200. www.googletagmanager.com returns status 400. In real, the URL shouldn't be checked to avoid errors like that: categories/index.html Non-OK status: 400 --- categories/index.html --> https://www.googletagmanager.com/

To Reproduce

Steps to reproduce the behaviour:

  1. Create an HTML file with the line given: <link rel="preconnect" href="https://www.googletagmanager.com" crossorigin>
  2. Run htmltest on it.
  3. See error.

.htmltest.yml

No config file required.

Source files

See above.

Expected behaviour

No error should be raised for link rel preconnect URIs.

Actual behaviour

The URI is treated as a URL and checked for existence, and an error is thrown.

Versions

Additional context

More about link rel preconnect.

wjdp commented 1 year ago

Fixed this, we already had dns-prefetch ignored so follows easily.