Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.1.6
-
Fix Version/s: 1.2-RC2
-
Labels:None
Description
Currently the redirectToActualUrl method concatenates the contextPath static prefix and the linkUrl. When I'm running the CDN resources plugin the linkUrl is an absolute url so I get something like this:
http://myapp.com/static/http://myapp.com/static/style.min.css
I was able to fix that by changing the method as follows from:
def u = request.contextPath+staticUrlPrefix+res.linkUrl
to:
def u = !res.linkUrl?.contains( request.contextPath ) ? request.contextPath + staticUrlPrefix + res.linkUrl : res.linkUrl
Does this fix make sense? If so should I issue a pull request?
-Steve
I'll need to investigate this. Note that the redirect mechanism is only for legacy resources the you are not linking to correctly, it shouldn't really be used - I would fix that first because it means your stuff will not cache/update properly
The fix supplied will not be reliable because you can't just check for the context path being in a string. The context path can be blank for example, or a generic name like "user" which might occur elsewhere in a url