Skip to content

Commit

Permalink
#13 - improve asset url computation
Browse files Browse the repository at this point in the history
Signed-off-by: Clement Escoffier <[email protected]>
  • Loading branch information
cescoffier committed Jul 1, 2014
1 parent c85b8be commit ad6ce96
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ public String route(String method,
public String asset(String path) {
Asset asset = assets.assetAt(path);
if (asset == null) {
// If the path does not start with /, try with it.
if (!path.startsWith("/")) {
return asset("/" + path);
}
// Not found.
throw new TemplateProcessingException("Cannot find the URL of the asset " + path);
}
return asset.getPath();
Expand Down

0 comments on commit ad6ce96

Please sign in to comment.