Giter Site home page Giter Site logo

Comments (8)

didip avatar didip commented on September 15, 2024 1

Man, I keep not getting notified over email.

This does look like a bug. I will take a look at it closer, it has been a while.

from tollbooth.

didip avatar didip commented on September 15, 2024 1

v4.0.2

from tollbooth.

jack-chung avatar jack-chung commented on September 15, 2024 1

@didip Yes that's how I see this feature should work, based on the use case I outlined above. Also, this new code still supports the "aggregated limit" use case if needed. Just set the header value to a static value for all users, then it works just like before.

from tollbooth.

rvdwijngaard avatar rvdwijngaard commented on September 15, 2024

I was actually thinking the same; @didip can you please give your comments on this issue?

from tollbooth.

jack-chung avatar jack-chung commented on September 15, 2024

Agreed the headerValues part of the code looks not right. It's not checking the configured values against the request value, and also not using the request value to build the key.

from tollbooth.

didip avatar didip commented on September 15, 2024

This is a legitimate bug, see fix SHA above.

from tollbooth.

jack-chung avatar jack-chung commented on September 15, 2024

@didip For the case of a configured header name with no value, the new code puts the header name into the key but no value. I thought it's supposed to include the header value in the request as part of the key? Or did I misunderstand the intended use case?

Example:
If I want to throttle on a header called X-USER-ID, so that each user is bound by a request limit, this is not going to work with the new code (nor the old code). Only the header name is in the key, so different users coming from the same IP (e.g. behind corporate firewall) would all be subject to the same aggregated limit, not individual limits.

from tollbooth.

didip avatar didip commented on September 15, 2024

@jack-chung If you only define request header (without values) and if everyone visiting has X-USER-ID, then yes, they all limited under the same bucket.

Do you think they should all be limited as individual limit?

from tollbooth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.