Skip to content

Conversation

@pyama86
Copy link
Contributor

@pyama86 pyama86 commented Dec 23, 2023

I've made adjustments because there are cases where I want to block not just based on the host, but also on IP for limiters of GET parameters and request paths.

Copy link
Member

@k1LoW k1LoW left a comment

Choose a reason for hiding this comment

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

LGTM.

We need to choose host or remote_addr, right?

base_limiter.go Outdated
return false
}
func validateKey(key string) error {
for _, k := range []string{"remote_addr", "host"} {
Copy link
Member

@k1LoW k1LoW Dec 23, 2023

Choose a reason for hiding this comment

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

"remote_addr" and "host" may be const variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see.
I should to make constaiant variable host and remote_addr.

I will do afer cristmas..

@pyama86
Copy link
Contributor Author

pyama86 commented Dec 23, 2023

We need to choose host or remote_addr, right?.

Yes!!!
I think that you are always right!!!

Co-authored-by: Ken’ichiro Oyama <k1lowxb@gmail.com>
Copy link
Member

@k1LoW k1LoW left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!!!

@pyama86 pyama86 merged commit 9748e10 into main Dec 24, 2023
@pyama86 pyama86 deleted the support-select-key branch December 24, 2023 01:11
@github-actions github-actions bot mentioned this pull request Dec 24, 2023
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.

2 participants