phusion / passenger_library

Phusion Passenger documentation
https://www.phusionpassenger.com/docs
Other
48 stars 111 forks source link

linkchecker doesn't detect broken links on the same domain that miss the library prefix #50

Open OnixGH opened 7 years ago

OnixGH commented 7 years ago

When checking http://domain/library/* then all links to http://domain/somethingelse are seen as external and ignored. However, this causes a specific error case not to be seen: url_for links that have a non-existing destination.

For example: url_for('/install/valid.html') ==> http://domain/library/install/valid.html url_for('/install/invalid.html') ==> http://domain/install/invalid.html <-- not reported

OnixGH commented 7 years ago

Linkchecker offers --check-extern (to proceed to "external" links), and with either --ignore-url REGEX or --no-follow-url REGEX we should be able to keep it to the same domain.

It's probably a good idea to start checking external links (without following) as well.

OnixGH commented 7 years ago

For now, a simple Nginx workaround solves the immediate issue (by allowing use of linkchecker http://localhost/index.html):

location /index.html { return 302 sub/index.html; }
location / { deny all; return 404; }