+6
-8
| var append = require('append'); | ||
| var fs = require('fs'); | ||
| var path = require('path'); | ||
| var url = require('url'); | ||
| var sha1 = require('sha1'); | ||
@@ -311,6 +312,6 @@ var md5 = require('MD5'); | ||
| if (num != 0) | ||
| return pinged(new Error('Already sent pingbacks for '+res+'.')); | ||
| return pinged(new Error('Already sent pingbacks for "'+res+'".')); | ||
| // if not, send pingbacks | ||
| fs.readFile(path.resolve(self.opt.publicDirectory, res), 'utf8', | ||
| fs.readFile(path.resolve(self.opt.publicDirectory, './'+res), 'utf8', | ||
| function (err, html) { | ||
@@ -320,3 +321,4 @@ if (err) | ||
| Pingback.scan(html, self.opt.urlPrefix+res, function (err, pb) { | ||
| Pingback.scan(html, url.resolve(self.opt.urlPrefix, res), | ||
| function (err, pb) { | ||
| if (err) { | ||
@@ -354,8 +356,4 @@ return col.pingbacks.update({ _id: res }, { | ||
| ping.on('ping', function (source, target, next) { | ||
| // if target.pathname starts with slash, remove it | ||
| if (target.pathname[0] == '/') | ||
| target.pathname = target.pathname.substr(1); | ||
| // check if itβs a file | ||
| fs.stat(path.resolve(self.opt.publicDirectory, target.pathname), | ||
| fs.stat(path.resolve(self.opt.publicDirectory, '.'+target.pathname), | ||
| function (err, stats) { | ||
@@ -362,0 +360,0 @@ if (err) |
+1
-1
@@ -10,3 +10,3 @@ { | ||
| ], | ||
| "version": "0.4.4", | ||
| "version": "0.4.5", | ||
| "repository": { | ||
@@ -13,0 +13,0 @@ "type": "git", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
18064
-0.44%348
-0.29%4
33.33%