Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #28 from hstandaert/feature/request-undefined
Browse files Browse the repository at this point in the history
Early return path for server
  • Loading branch information
Chapabu authored Aug 4, 2019
2 parents a399e25 + 77219e6 commit 8a8bf20
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/filters/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ const utils = require('@frctl/fractal').utils;
module.exports = function(fractal) {

return function(path) {

let env = this.context._env;
let request = env.request || this.context._request;
if (!env || env.server) {
return path;
}

return (! env || env.server) ? path : utils.relUrlPath(path, _.get(request, 'path', '/'), fractal.web.get('builder.urls'));
let request = env.request || this.context._request;
return utils.relUrlPath(path, _.get(request, 'path', '/'), fractal.web.get('builder.urls'));
}

};

0 comments on commit 8a8bf20

Please sign in to comment.