Skip to content

Commit

Permalink
#13 - improve asset path 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 886b1a7 commit fbc3911
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ 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);
// If the path starts with "/", try without
if (path.startsWith("/")) {
return asset(path.substring(1));
}
// Not found.
throw new TemplateProcessingException("Cannot find the URL of the asset " + path);
Expand Down

0 comments on commit fbc3911

Please sign in to comment.