Skip to content

result.statusCode: 0 being returned by many external links #220

Description

@chris-dura

I've recently started getting a result.statusCode: 0 returned when checking my markdown files.

'use strict';

/**
 * @fileoverview This is a stub test to use the `markdown-link-check` library directly,
 * to test whether the problem is truly with `markdown-link-check`,
 * or the underlying `link-check` library
 */

const markdownLinkCheck = require('markdown-link-check');

markdownLinkCheck('[example](http://google.com)', function (err, results) {
	if (err) {
		console.error('Error', err);
		return;
	}
	results.forEach(function (result) {
		console.log('%s is %s', result.link, result.status, result.statusCode);
	});
});

markdownLinkCheck('[example](https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts)', function (err, results) {
	if (err) {
		console.error('Error', err);
		return;
	}
	results.forEach(function (result) {
		console.log('%s is %s', result.link, result.status, result.statusCode);
	});
});


// output:
// http://google.com is alive 200
// https://dequeuniversity.com/screenreaders/voiceover-keyboard-shortcuts is dead 0

Is this perhaps related to tcort/link-check#47 (comment)?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions