Skip to content

Commit

Permalink
Add support for relative webroot paths.
Browse files Browse the repository at this point in the history
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
ianoxley committed Jan 30, 2012
1 parent cda9b3c commit a18d4bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/paperboy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a18d4bc

Please sign in to comment.