mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-10 12:12:40 +02:00
32 lines
737 B
Go
32 lines
737 B
Go
package security
|
|
|
|
import (
|
|
"github.com/imgproxy/imgproxy/v3/config"
|
|
)
|
|
|
|
type Options struct {
|
|
MaxSrcResolution int
|
|
MaxSrcFileSize int
|
|
MaxAnimationFrames int
|
|
MaxAnimationFrameResolution int
|
|
MaxResultDimension int
|
|
}
|
|
|
|
func DefaultOptions() Options {
|
|
return Options{
|
|
MaxSrcResolution: config.MaxSrcResolution,
|
|
MaxSrcFileSize: config.MaxSrcFileSize,
|
|
MaxAnimationFrames: config.MaxAnimationFrames,
|
|
MaxAnimationFrameResolution: config.MaxAnimationFrameResolution,
|
|
MaxResultDimension: config.MaxResultDimension,
|
|
}
|
|
}
|
|
|
|
func IsSecurityOptionsAllowed() error {
|
|
if config.AllowSecurityOptions {
|
|
return nil
|
|
}
|
|
|
|
return newSecurityOptionsError()
|
|
}
|