Skip to content
Browse files

Don't render URLs absolute

Play will take care of it, when the route contains a host.
  • Loading branch information...
1 parent 220d3ea commit 57d79222e2a112d1e84423e9cdc035cf24379a7e Florian Gutmann committed
Showing with 7 additions and 10 deletions.
  1. +7 −10 app/press/Plugin.java
View
17 app/press/Plugin.java
@@ -234,13 +234,13 @@ private static void checkForDuplicates(Map<String, Boolean> files, String fileNa
private static String getRenderedCSSUrl(String src) {
HashMap<String, Object> args = new HashMap<String, Object>();
args.put("file", src);
- return getActionUrl("press.Press.getRenderedCSS", args);
+ return Router.reverse("press.Press.getRenderedCSS", args).url;
}
private static String getRenderedJSUrl(String src) {
HashMap<String, Object> args = new HashMap<String, Object>();
args.put("file", src);
- return getActionUrl("press.Press.getRenderedJS", args);
+ return Router.reverse("press.Press.getRenderedJS", args).url;
}
private static String getSingleCompressedCSSUrl(String requestKey) {
@@ -262,7 +262,7 @@ private static String getCompressedJSUrl(String requestKey) {
private static String getCompressedUrl(String action, String requestKey) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("key", FileIO.escape(requestKey));
- return getActionUrl(action, params);
+ return Router.reverse(action, params).url;
}
/**
@@ -284,14 +284,11 @@ private static String getLinkTag(String src) {
+ (press.PluginConfig.htmlCompatible ? "" : "</link>") + "\n";
}
- private static String getActionUrl(String action, Map<String, Object> args) {
- ActionDefinition def = Router.reverse(action, args);
- def.absolute();
- return def.url;
- }
-
+ /**
+ * Gets a URL to a static file
+ */
private static String getStaticUrl(String url) {
- return Router.reverse(Play.getVirtualFile(url), true);
+ return Router.reverse(Play.getVirtualFile(url));
}
}

0 comments on commit 57d7922

Please sign in to comment.
Something went wrong with that request. Please try again.