Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: support more key for limit-rate, limit-count, limit-conn #444

Merged
merged 3 commits into from
Aug 27, 2019
Merged

feature: support more key for limit-rate, limit-count, limit-conn #444

merged 3 commits into from
Aug 27, 2019

Conversation

membphis
Copy link
Member

fix #228

@membphis membphis requested a review from moonming August 26, 2019 15:33
key = {type = "string", enum = {"remote_addr", "server_addr"}},
key = {type = "string",
enum = {"remote_addr", "server_addr", "http_x_real_ip",
"http_x_forwarded_for"},
Copy link
Member

Choose a reason for hiding this comment

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

we should not hard code the key of headers or args

Copy link
Member

Choose a reason for hiding this comment

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

user can specify the value of key, which's the point.

@@ -50,12 +53,12 @@ function _M.access(conf, ctx)
end

local key = (ctx.var[conf.key] or "") .. ctx.conf_type .. ctx.conf_version
Copy link
Member

Choose a reason for hiding this comment

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

ctx.var can also get value from headers?

Copy link
Member

Choose a reason for hiding this comment

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

I think we should use core.request.header

@moonming moonming merged commit c32da7c into apache:master Aug 27, 2019
@membphis membphis deleted the limit-new-key branch August 29, 2019 12:27
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.

support more key for limit-rate, limit-count, limit-conn
2 participants