link-check
Advanced tools
Comparing version 4.5.3 to 4.5.4
# Changes | ||
## Version 4.5.4 | ||
* #35 fix encode by adding decode first | ||
## Version 4.5.3 | ||
@@ -4,0 +8,0 @@ |
@@ -30,3 +30,4 @@ "use strict"; | ||
const options = { | ||
uri: encodeURI(link), | ||
// Decoding and encoding is required to prevent encoding already encoded URLs | ||
uri: encodeURI(decodeURI(link)), | ||
headers: { | ||
@@ -33,0 +34,0 @@ // override 'User-Agent' (some sites return `401` when the user-agent isn't a web browser) |
{ | ||
"name": "link-check", | ||
"version": "4.5.3", | ||
"version": "4.5.4", | ||
"description": "checks whether a hyperlink is alive (200 OK) or dead", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -127,2 +127,6 @@ 'use strict'; | ||
app.get('/url_\\(with_parentheses\\)', function (req, res) { | ||
res.sendStatus(200); | ||
}); | ||
const server = http.createServer(app); | ||
@@ -476,2 +480,14 @@ server.listen(0 /* random open port */, 'localhost', function serverListen(err) { | ||
it('should not encode already encoded characters', function(done) { | ||
laterCustomRetryCounter = 0; | ||
linkCheck(baseUrl + '/url_%28with_parentheses%29', function(err, result) { | ||
console.log(err, result); | ||
expect(err).to.be(null); | ||
expect(result.err).to.be(null); | ||
expect(result.status).to.be('alive'); | ||
expect(result.statusCode).to.be(200); | ||
done(); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34144
607