boxingbeetle / apetest

Smarter-than-monkey testing for web apps
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Option to warn when absolute URLs are used #1

Open mthuurne opened 5 years ago

mthuurne commented 5 years ago

Some static HTML content is intended for local use or should be deployable on web servers at any directory level. In those cases, absolute URLs are undesired, because they can result in broken links in practice, even though they might happen to exist in the test environment.

For web apps that are designed to be embedded in larger sites, absolute URLs have to be rewritten by a reverse proxy. Avoiding absolute URLs simplifies the web server setup and lightens the load.

So it would be useful to have an option to flag absolute URLs as warnings.

mthuurne commented 4 years ago

A related question is how absolute URLs should be handled when checking local files (file: URLs). It seems currently they are ignored, probably because they are considered external links. However, when checking a full copy of a site as local files, this means absolute URLs are not followed and broken links are not detected.

mthuurne commented 3 years ago

A related question is how absolute URLs should be handled when checking local files (file: URLs). It seems currently they are ignored, probably because they are considered external links. However, when checking a full copy of a site as local files, this means absolute URLs are not followed and broken links are not detected.

An absolute link such as /contact is resolved to file:///contact and then rejected as external. It would be more useful to treat the given path as the root of the web site instead.

I don't think this is a strongly related issue though, so I opened a separate ticket for it: #32.