Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit a18d4bcb95c72b9fafce6889ba3d17ddb605189a 1 parent cda9b3c
@ianoxley ianoxley authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/paperboy.js
View
3  lib/paperboy.js
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.