mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-07-02 22:46:50 +02:00
Fix options rewrite
This commit is contained in:
@ -335,12 +335,12 @@ func (s *ProcessingOptionsTestSuite) TestParsePathAdvancedWatermark() {
|
||||
|
||||
func (s *ProcessingOptionsTestSuite) TestParsePathAdvancedPreset() {
|
||||
conf.Presets["test1"] = urlOptions{
|
||||
"resizing_type": []string{"fill"},
|
||||
urlOption{Name: "resizing_type", Args: []string{"fill"}},
|
||||
}
|
||||
|
||||
conf.Presets["test2"] = urlOptions{
|
||||
"blur": []string{"0.2"},
|
||||
"quality": []string{"50"},
|
||||
urlOption{Name: "blur", Args: []string{"0.2"}},
|
||||
urlOption{Name: "quality", Args: []string{"50"}},
|
||||
}
|
||||
|
||||
req := s.getRequest("http://example.com/unsafe/preset:test1:test2/plain/http://images.dev/lorem/ipsum.jpg")
|
||||
@ -356,9 +356,9 @@ func (s *ProcessingOptionsTestSuite) TestParsePathAdvancedPreset() {
|
||||
|
||||
func (s *ProcessingOptionsTestSuite) TestParsePathPresetDefault() {
|
||||
conf.Presets["default"] = urlOptions{
|
||||
"resizing_type": []string{"fill"},
|
||||
"blur": []string{"0.2"},
|
||||
"quality": []string{"50"},
|
||||
urlOption{Name: "resizing_type", Args: []string{"fill"}},
|
||||
urlOption{Name: "blur", Args: []string{"0.2"}},
|
||||
urlOption{Name: "quality", Args: []string{"50"}},
|
||||
}
|
||||
|
||||
req := s.getRequest("http://example.com/unsafe/quality:70/plain/http://images.dev/lorem/ipsum.jpg")
|
||||
@ -374,12 +374,12 @@ func (s *ProcessingOptionsTestSuite) TestParsePathPresetDefault() {
|
||||
|
||||
func (s *ProcessingOptionsTestSuite) TestParsePathAdvancedPresetLoopDetection() {
|
||||
conf.Presets["test1"] = urlOptions{
|
||||
"resizing_type": []string{"fill"},
|
||||
urlOption{Name: "resizing_type", Args: []string{"fill"}},
|
||||
}
|
||||
|
||||
conf.Presets["test2"] = urlOptions{
|
||||
"blur": []string{"0.2"},
|
||||
"quality": []string{"50"},
|
||||
urlOption{Name: "blur", Args: []string{"0.2"}},
|
||||
urlOption{Name: "quality", Args: []string{"50"}},
|
||||
}
|
||||
|
||||
req := s.getRequest("http://example.com/unsafe/preset:test1:test2:test1/plain/http://images.dev/lorem/ipsum.jpg")
|
||||
@ -553,10 +553,10 @@ func (s *ProcessingOptionsTestSuite) TestParsePathSignedInvalid() {
|
||||
func (s *ProcessingOptionsTestSuite) TestParsePathOnlyPresets() {
|
||||
conf.OnlyPresets = true
|
||||
conf.Presets["test1"] = urlOptions{
|
||||
"blur": []string{"0.2"},
|
||||
urlOption{Name: "blur", Args: []string{"0.2"}},
|
||||
}
|
||||
conf.Presets["test2"] = urlOptions{
|
||||
"quality": []string{"50"},
|
||||
urlOption{Name: "quality", Args: []string{"50"}},
|
||||
}
|
||||
|
||||
req := s.getRequest("http://example.com/unsafe/test1:test2/plain/http://images.dev/lorem/ipsum.jpg")
|
||||
@ -573,10 +573,10 @@ func (s *ProcessingOptionsTestSuite) TestParsePathOnlyPresets() {
|
||||
func (s *ProcessingOptionsTestSuite) TestParseBase64URLOnlyPresets() {
|
||||
conf.OnlyPresets = true
|
||||
conf.Presets["test1"] = urlOptions{
|
||||
"blur": []string{"0.2"},
|
||||
urlOption{Name: "blur", Args: []string{"0.2"}},
|
||||
}
|
||||
conf.Presets["test2"] = urlOptions{
|
||||
"quality": []string{"50"},
|
||||
urlOption{Name: "quality", Args: []string{"50"}},
|
||||
}
|
||||
|
||||
imageURL := "http://images.dev/lorem/ipsum.jpg?param=value"
|
||||
|
Reference in New Issue
Block a user