allow setting max height and width

This is primarily added to prevent a denial of service attack where
insanely large images are requested, eating up CPU.
This commit is contained in:
Will Norris 2013-12-06 14:17:39 -08:00
parent 8310f6eb79
commit 036d0c51c4
2 changed files with 12 additions and 0 deletions

View file

@ -21,6 +21,8 @@ func main() {
p := proxy.NewProxy(nil)
p.Cache = cache.NewMemoryCache()
p.MaxWidth = 2000
p.MaxHeight = 2000
if *whitelist != "" {
p.Whitelist = strings.Split(*whitelist, ",")
}