mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-11 04:32:29 +02:00
IMG-57: introduce processing options factory (#1526)
* Intoduced options.Factory * ProcessingOptionsFactory in processing and watermark * Clone with testutil.Helper
This commit is contained in:
@@ -168,7 +168,7 @@ func (s *ProcessingHandlerTestSuite) TestResultingFormatNotSupported() {
|
||||
}
|
||||
|
||||
func (s *ProcessingHandlerTestSuite) TestSkipProcessingConfig() {
|
||||
config.SkipProcessingFormats = []imagetype.Type{imagetype.PNG}
|
||||
s.Config().Options.SkipProcessingFormats = []imagetype.Type{imagetype.PNG}
|
||||
|
||||
res := s.GET("/unsafe/rs:fill:4:4/plain/local:///test1.png")
|
||||
|
||||
@@ -184,7 +184,7 @@ func (s *ProcessingHandlerTestSuite) TestSkipProcessingPO() {
|
||||
}
|
||||
|
||||
func (s *ProcessingHandlerTestSuite) TestSkipProcessingSameFormat() {
|
||||
config.SkipProcessingFormats = []imagetype.Type{imagetype.PNG}
|
||||
s.Config().Options.SkipProcessingFormats = []imagetype.Type{imagetype.PNG}
|
||||
|
||||
res := s.GET("/unsafe/rs:fill:4:4/plain/local:///test1.png@png")
|
||||
|
||||
@@ -477,7 +477,7 @@ func (s *ProcessingHandlerTestSuite) TestAlwaysRasterizeSvg() {
|
||||
|
||||
func (s *ProcessingHandlerTestSuite) TestAlwaysRasterizeSvgWithEnforceAvif() {
|
||||
config.AlwaysRasterizeSvg = true
|
||||
config.EnforceWebp = true
|
||||
s.Config().Options.EnforceWebp = true
|
||||
|
||||
res := s.GET("/unsafe/plain/local:///test1.svg", http.Header{"Accept": []string{"image/webp"}})
|
||||
|
||||
@@ -487,7 +487,7 @@ func (s *ProcessingHandlerTestSuite) TestAlwaysRasterizeSvgWithEnforceAvif() {
|
||||
|
||||
func (s *ProcessingHandlerTestSuite) TestAlwaysRasterizeSvgDisabled() {
|
||||
config.AlwaysRasterizeSvg = false
|
||||
config.EnforceWebp = true
|
||||
s.Config().Options.EnforceWebp = true
|
||||
|
||||
res := s.GET("/unsafe/plain/local:///test1.svg")
|
||||
|
||||
@@ -497,7 +497,7 @@ func (s *ProcessingHandlerTestSuite) TestAlwaysRasterizeSvgDisabled() {
|
||||
|
||||
func (s *ProcessingHandlerTestSuite) TestAlwaysRasterizeSvgWithFormat() {
|
||||
config.AlwaysRasterizeSvg = true
|
||||
config.SkipProcessingFormats = []imagetype.Type{imagetype.SVG}
|
||||
s.Config().Options.SkipProcessingFormats = []imagetype.Type{imagetype.SVG}
|
||||
|
||||
res := s.GET("/unsafe/plain/local:///test1.svg@svg")
|
||||
|
||||
@@ -506,7 +506,7 @@ func (s *ProcessingHandlerTestSuite) TestAlwaysRasterizeSvgWithFormat() {
|
||||
}
|
||||
|
||||
func (s *ProcessingHandlerTestSuite) TestMaxSrcFileSizeGlobal() {
|
||||
config.MaxSrcFileSize = 1
|
||||
s.Config().Security.DefaultOptions.MaxSrcFileSize = 1
|
||||
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
|
||||
rw.WriteHeader(200)
|
||||
|
Reference in New Issue
Block a user