mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-01 15:52:41 +02:00
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:
parent
8310f6eb79
commit
036d0c51c4
2 changed files with 12 additions and 0 deletions
|
|
@ -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, ",")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue