Review Board 1.5.4

Widen the whitelist for file extensions

Updated 2 years, 2 months ago

Tim Perrett Reviewers
wip_tim_209
209 dchenbecker, dpp, marius, kris, indrajit, alexb
None LiftWeb-archive
Based on this discussion:
http://groups.google.com/group/liftweb/browse_thread/thread/e189fc4a2726a94f

I  made this change to widen the file extension whitelist. 
Some testing
Ship it!
Posted 2 years, 2 months ago (November 25th, 2009, 10:40 a.m.)
Cool beans
Ship it!
Posted 2 years, 2 months ago (November 25th, 2009, 10:47 a.m.)
Great stuff!
Ship it!
Posted 2 years, 2 months ago (November 25th, 2009, 10:47 a.m.)
Great stuff!
Posted 2 years, 2 months ago (November 25th, 2009, 11:07 a.m.)
Ok I hate to be the black sheep here :( ... I mean what Tim did is great (probably the scala doc should reflect that) but keeping around a list (which is not that small) is unsound to me. 
And we may do for each request a search in a list of more that 400 items ... this is starting to concern me.

I wonder why not simply consider the suffix the part after last '.' ... I know there was a bug about that but we could allow the user to do custom breakout by registering a LiftRules function. So by default this breakout function takes the part after last dot and users could provide their own splitting functions if they need a different splitting behavior. Perhaps even register different splitting functions per ParsePath excluding of course the last part of the Path.


  1. The list is a Set, so it's an O(1) lookup in a hashtable... not very costly.
Posted 2 years, 2 months ago (November 26th, 2009, 10:30 a.m.)
I think it's good to have a longer set of extensions by default, however I think the list values should be externalized in a file.  

Suggestion:  loading the list from a classpath resource so it's easily overridable by adding a file into the .war file.  Default would be to load the supplied list from lift-webkit.jar