Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails on mailto: links #60

Open
rondonjon opened this issue Nov 4, 2019 · 0 comments
Open

Fails on mailto: links #60

rondonjon opened this issue Nov 4, 2019 · 0 comments

Comments

@rondonjon
Copy link

rondonjon commented Nov 4, 2019

runValidator fails with an exception when a mailto: URL is found in the page. The application then terminates with:

internal/validators.js:112
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
    at validateString (internal/validators.js:112:11)
    at Object.basename (path.js:1157:5)
    at runValidator (/home/eon/eon-com-relaunch/node_modules/w3c-link-validator/src/w3clink.js:72:22)
    at Request._callback (/home/eon/eon-com-relaunch/node_modules/w3c-link-validator/src/w3clink.js:120:13)
    at Request.self.callback (/home/eon/eon-com-relaunch/node_modules/request/request.js:185:22)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/eon/eon-com-relaunch/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/eon/eon-com-relaunch/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:299:28) {
  code: 'ERR_INVALID_ARG_TYPE'
}

I have been able to resolve this by replacing

var _base = path.basename(urlinfo.pathname);

with

var _base = path.basename(urlinfo.pathname || urlinfo.href);

but I haven't really tested it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants