Open massongit opened 2 years ago
When request with {redirect: 'follow'}
option, httpstat return dead link.
First HEAD Request is succuss, but second redirect:follow request is failed. https://github.com/textlint-rule/textlint-rule-no-dead-link/blob/6c723f6249573a7154d25cc80a104ffc00ad270a/src/no-dead-link.js#L171-L174
I'm not faimilar with {redirect: follow}
works.
reproduce code. HEAD with follow is broken.
await fetch("https://httpstat.us", { method: "HEAD", redirect: "follow"})
// [HTTP/1.1 405 Method Not Allowed 144ms]
// Response { type: "basic", url: "https://httpstat.us/", redirected: false, status: 405, ok: false, statusText: "Method Not Allowed", headers: Headers, body: ReadableStream, bodyUsed: false }
await fetch("https://httpstat.us", { method: "HEAD" })
It looks like that https://httpstat.us/ top page does not allow HEAD request. I do not know that this is expected behavior. Probably, It is reguression bug.
https://github.com/textlint-rule/textlint-rule-no-dead-link/issues/138#issuecomment-1019400545
This finalRes
line does not donsider to treat the request error.
It may be a bug.
Workaround: We can also use altenerive site like https://httpbin.org/ as workaround.
The following tests failed: