Comparing version 0.4.4 to 0.4.5
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) |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"repository": { | ||
@@ -13,0 +13,0 @@ "type": "git", |
18064
348