1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-07-12 23:00:55 +02:00

Implements #421 processing option to control meta stripping (#422)

* Implements processing option to control meta stripping

* Update based on code review comments

Change name of option to "stripmeta" and change how we handle config vs request setting logic

* Fix indentation style typo

* Fix indentation style typo

* Use full metadata naming for config and variables

Co-authored-by: John Koehl <johnk@zillowgroup.com>
Co-authored-by: John Koehl <jkoehl>
This commit is contained in:
John Koehl
2020-07-01 09:45:33 -04:00
committed by GitHub
parent bb695fa2c4
commit 616ec996b3
4 changed files with 68 additions and 35 deletions

View File

@ -405,6 +405,16 @@ func (s *ProcessingOptionsTestSuite) TestParsePathAdvancedCachebuster() {
assert.Equal(s.T(), "123", po.CacheBuster)
}
func (s *ProcessingOptionsTestSuite) TestParsePathAdvancedStripMetadata() {
req := s.getRequest("http://example.com/unsafe/strip_metadata:true/plain/http://images.dev/lorem/ipsum.jpg")
ctx, err := parsePath(context.Background(), req)
require.Nil(s.T(), err)
po := getProcessingOptions(ctx)
assert.True(s.T(), po.StripMetadata)
}
func (s *ProcessingOptionsTestSuite) TestParsePathWebpDetection() {
conf.EnableWebpDetection = true