stevenvachon / broken-link-checker

Find broken links, missing images, etc within your HTML.
MIT License
1.97k stars 305 forks source link

Improper handling of / configuration for 3xx redirect status codes #140

Closed addisonlynch closed 5 years ago

addisonlynch commented 5 years ago

I understand this may have similarities to #47, #49, #119, and #78, but I wanted to see what the proper procedure is for handling redirect URLs.

Consider these simple http -> https redirects which end in a 200 response after a 307:

This package reports these links as below:

image

This should not be the correct behavior, as the links are not broken. They redirect to a different site, which returns a 200, an 'OK' status code. For most users' purposes, these links are 'OK'.

Is there some option in this package which allows handling of these redirects differently than the default behavior? We are unable to use this checker as it is overreporting the number of broken links on our sites.

Any help would be greatly appreciated.

Thanks!

stevenvachon commented 5 years ago

Does this happen with the v0.8.0 branch?

addisonlynch commented 5 years ago

Works now, thank you!

ttobis commented 4 years ago

@stevenvachon thank you for this great tool! Question: how can I get this fix via npm? I tried: npm install https://github.com/stevenvachon/broken-link-checker It installs everything, but there is error thrown when executing any command:

module.js:550
    throw err;
    ^

Error: Cannot find module '../lib-cjs/cli'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/ttobis/here/repo/qad/node_modules/broken-link-checker/bin/blc:3:1)

Wouldn't it be possible to put this fixed version to npm?

Thanks!

stevenvachon commented 4 years ago

@ttobis npm run build