You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I apologize, I'm not quite sure if this is applicable to your library or to normalize-url.
I was running another package - (glyphhanger),. I was able to narrow it down and reproduce the error solely using spider-pig.
The issue is that spiderpig (or normalize-url) treats links with the tel protocol as http:// instead of ignoring the url; resulting in an error which I included at the bottom of this issue.
install spiderpig (I did by npm install -g @zachleat/spider-pig)
take the test-case html file, uploaded to a server
run DEBUG=SpiderPig spiderpig the/path/to/test-case.html
receive error in console (shown at the bottom)
As far as I understand, the tel protocol has the + sign as optional at the beginning of the resource; I am able to reproduce the error regardless if the + is included.
According to the RFC standard, these are valid telephone links and they work for me in other circumstances.
The full error that I received is below:
DEBUG=SpiderPig spiderpig http://localhost:8000/test-case.html
SpiderPig Found origin: 'http://localhost:8000' +0ms
SpiderPig Found link hrefs: [ 'local-url.html', 'mailto:email@null.com', 'tel:+1-202-762-1401', 'tel:1-202-762-1401' ] +19ms
SpiderPig Cleaned href: 'http://localhost:8000/local-url.html' (origin: 'http://localhost:8000/test-case.html') +7ms
SpiderPig Cleaned href: 'http://null.com' (origin: 'http://localhost:8000/test-case.html') +2ms
(node:32311) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_URL]: Invalid URL: http:tel:+1-202-762-1401
at onParseError (internal/url.js:257:9)
at new URL (internal/url.js:333:5)
at normalizeUrl (/home/skoraw/.nvm/versions/node/v12.20.0/lib/node_modules/@zachleat/spider-pig/node_modules/normalize-url/index.js:98:17)
at SpiderPig.cleanupHref (/home/skoraw/.nvm/versions/node/v12.20.0/lib/node_modules/@zachleat/spider-pig/SpiderPig.js:22:10)
at SpiderPig.fetchLocalUrls (/home/skoraw/.nvm/versions/node/v12.20.0/lib/node_modules/@zachleat/spider-pig/SpiderPig.js:118:16)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async /home/skoraw/.nvm/versions/node/v12.20.0/lib/node_modules/@zachleat/spider-pig/cmd.js:22:13
(node:32311) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:32311) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The text was updated successfully, but these errors were encountered:
Hi,
I apologize, I'm not quite sure if this is applicable to your library or to normalize-url.
I was running another package - (glyphhanger),. I was able to narrow it down and reproduce the error solely using spider-pig.
The issue is that spiderpig (or normalize-url) treats links with the
tel
protocol as http:// instead of ignoring the url; resulting in an error which I included at the bottom of this issue.The test-case html file is available at: https://gist.github.com/skorasaurus/8107812d6e34ce3cbd0d5f1bfd318a80
To reproduce:
npm install -g @zachleat/spider-pig
)DEBUG=SpiderPig spiderpig the/path/to/test-case.html
As far as I understand, the
tel
protocol has the+
sign as optional at the beginning of the resource; I am able to reproduce the error regardless if the+
is included.According to the RFC standard, these are valid telephone links and they work for me in other circumstances.
The full error that I received is below:
The text was updated successfully, but these errors were encountered: