Skip to content

feat(gzip): support special * to match any type#4817

Merged
spacewander merged 2 commits into
apache:masterfrom
RocFang:glob_gzip
Aug 16, 2021
Merged

feat(gzip): support special * to match any type#4817
spacewander merged 2 commits into
apache:masterfrom
RocFang:glob_gzip

Conversation

@RocFang

@RocFang RocFang commented Aug 13, 2021

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

right now, type of types attr is array, and we dont't have a method to support the special gzip_types * config in Nginx Core. So maybe we can change type of types to support single string, and support * too.

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Comment thread apisix/plugins/gzip.lua Outdated
},
},
{
type = "string",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think enum = {"*"} is enough?

@RocFang RocFang Aug 13, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spacewander Yes, I think it's simpler to use {"*"}, this pr only try to follow nginx's config strictly.
If that not import, I will change it to {"*"}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misunderstood you firstly, now i got it.

Comment thread t/plugin/gzip.t Outdated
012345678
--- more_headers
Accept-Encoding: gzip
Content-Type: text/html

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use a special type to verify that any type can be matched.

@RocFang RocFang changed the title feat(gzip): support single string type and * to match any type feat(gzip): support special * to match any type Aug 13, 2021
@spacewander
spacewander merged commit e244940 into apache:master Aug 16, 2021
@RocFang
RocFang deleted the glob_gzip branch August 16, 2021 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants