Permalink
Browse files

Add support for relative webroot paths.

When passing a webroot to paperboy, you can now use a path relative to
the current working directory. Absolute paths still work fine too.
  • Loading branch information...
1 parent cda9b3c commit a18d4bcb95c72b9fafce6889ba3d17ddb605189a @ianoxley ianoxley committed Jan 30, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/paperboy.js
View
@@ -6,7 +6,8 @@ var
exports.filepath = function (webroot, url) {
- var pathSep=process.platform =='win32' ? '\\' : '/'
+ webroot = path.resolve(webroot || '.');
+ var pathSep=process.platform =='win32' ? '\\' : '/';
// Unescape URL to prevent security holes
url = decodeURIComponent(url);
// Strip nullbytes (they can make us believe that the file extension isn't the one it really is)

0 comments on commit a18d4bc

Please sign in to comment.