From dbdb301c1e4c81425f6629c500edd233fe17d3a7 Mon Sep 17 00:00:00 2001 From: Jorgen Evens Date: Fri, 30 Sep 2016 11:47:55 +0200 Subject: [PATCH] Links relative to the server root are also relative. --- lib/plugin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/plugin.js b/lib/plugin.js index 19147b9f..d9b78791 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -373,7 +373,11 @@ exports.register = function (server, opts, next) { }; internals.isRelativePath = function (path) { - return path && (path.substring(0, 2) === './' || path.substring(0, 3) === '../'); + return path && ( + path.substring(0, 2) === './' || + path.substring(0, 3) === '../' || + path.substring(0, 1) === '/' + ); }; /**