Skip to content

Commit

Permalink
Fix an issue where isAlive() was sometimes failed to complete a request
Browse files Browse the repository at this point in the history
  • Loading branch information
nodaguti committed Mar 17, 2016
1 parent 38ef2e1 commit f603a09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/no-dead-link.js
Expand Up @@ -20,6 +20,7 @@ async function isAlive(uri) {
try {
const res = await fetch(uri, {
method: 'HEAD',
gzip: false,
});
return {
ok: res.ok,
Expand Down
20 changes: 10 additions & 10 deletions test/no-dead-link.js
Expand Up @@ -5,38 +5,38 @@ const tester = new TextlintTester();

tester.run('no-dead-link', rule, {
valid: [
'Normal URI: http://example.com/',
'Normal link: [example](http://example.com)',
'Normal URI: https://example.com/',
'Normal link: [example](https://example.com/)',
{
text: 'Options: relative link: ![robot](/images/errors/robot.gif)',
text: 'Options: relative link: ![robot](index.html)',
options: {
checkRelative: true,
baseURI: 'https://www.google.com/',
baseURI: 'https://example.com/',
},
},
{
text: 'Options: ignore: http://example.com/404',
text: 'Options: ignore: https://example.com/404.html',
options: {
ignore: ['http://example.com/404'],
ignore: ['https://example.com/404.html'],
},
},
],
invalid: [
{
text: '404 URI: http://example.com/404',
text: '404 URI: https://example.com/404.html',
errors: [
{
message: 'http://example.com/404 is dead. (404 Not Found)',
message: 'https://example.com/404.html is dead. (404 Not Found)',
line: 1,
column: 10,
},
],
},
{
text: '404 link: [404](http://example.com/404)',
text: '404 link: [404](https://example.com/404.html)',
errors: [
{
message: 'http://example.com/404 is dead. (404 Not Found)',
message: 'https://example.com/404.html is dead. (404 Not Found)',
line: 1,
column: 11,
},
Expand Down

0 comments on commit f603a09

Please sign in to comment.