History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: UP-1779
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Unassigned
Reporter: Nick Bolton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
uPortal

fileNameGenerator of ProxyWriter exposes cache collisions for given classes of lengthy urls

Created: 01/Aug/07 04:17 PM   Updated: 29/Aug/07 05:31 PM
Component/s: Resource Proxy
Affects Version/s: 2.6.0 RC1, 2.6.0 RC2
Fix Version/s: 2.6.0 GA

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
ProxyWriter.fileNameGenerator is responsible for mapping a javascript resource into a filename for caching. It will take up to the first 16 characters of the filtered url.

private static String fileNameGenerator(String addr) {
        String newName = CommonUtils.replaceText(addr, "/", "");
        newName = CommonUtils.replaceText(newName, "http:", "");
        newName = CommonUtils.replaceText(newName, "www.", "");
        newName = CommonUtils.replaceText(newName, ".", "");
        newName = CommonUtils.replaceText(newName, "?", "");
        newName = CommonUtils.replaceText(newName, "&", "");

        return newName.substring(0, Math.min(16, newName.length())) + ".html";
}

This will cause cache collisions for longer urls. e.g.

http://www.uportal.org/path/to/the/file/javascript.js
http://www.uportal.org/path/to/the/file/javascript2.js

Both will get mapped to uportalorgpathto

This should be refactored into perhaps a file system structure. So that http://www.uportal.org/path/to/the/file/javascript.js would get mapped to org.jasig.portal.serialize.ProxyWriter.proxy_files_path + /path/to/the/file/javascript.js.

 All   Comments   Work Log   Change History      Sort Order:
Susan Bramhall [03/Aug/07 10:22 PM]
Not needed because no longer caching items to be proxied later