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

ERROR Rack::Lint::LintError #1

Closed
kris opened this issue Feb 5, 2011 · 4 comments
Closed

ERROR Rack::Lint::LintError #1

kris opened this issue Feb 5, 2011 · 4 comments
Assignees

Comments

@kris
Copy link

kris commented Feb 5, 2011

Hi, was trying to use rack-throttle on Interval 3sec, and it works just fine until you hit the threshold, in which it errors out with:

[2011-02-04 21:00:37] ERROR Rack::Lint::LintError: Response body must respond to each
/Users/kris/.rvm/gems/ruby-1.9.2-p136@rails3/gems/rack-1.2.1/lib/rack/lint.rb:19:in assert' /Users/kris/.rvm/gems/ruby-1.9.2-p136@rails3/gems/rack-1.2.1/lib/rack/lint.rb:513:ineach'
/Users/kris/.rvm/gems/ruby-1.9.2-p136@rails3/gems/rack-1.2.1/lib/rack/handler/webrick.rb:64:in service' /Users/kris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/webrick/httpserver.rb:111:inservice'
/Users/kris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/webrick/httpserver.rb:70:in run' /Users/kris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/webrick/server.rb:183:inblock in start_thread'

bensomers referenced this issue in bensomers/improved-rack-throttle Oct 5, 2012
#1: fix bug that prevented making changes to the parameters
#2: fix bug that allowed buckets to overfill, 
causing them to empty too slowly and wind up punishing
offenders in proportion to how badly they offended
(instead of capping out the punishment at a certain
level)
@basayel
Copy link

basayel commented Nov 1, 2012

I am facing the same problem .. Any luck with that ?

@bensomers
Copy link

This is actually the same bug as issues #2 and #6. The Rack standard dictates that a response body should respond to #each; It's because Limiter#rate_limit_exceeded is returning its response as a String, which responded to #each in ruby 1.8 but does not in 1.9. The correct fix is to wrap the response body in an array, as in 02297be.

You should try using one of the forks, most of them incorporate this fix or have made it independently. Mainline appears pretty strongly to be unmaintained. I'll obviously plug for mine (https://github.com/bensomers/improved-rack-throttle), but there are several that would work.

(Incidentally, my commit referencing this issue is an example of github's Markdown being overly aggressive. I actually just wanted a numbered list in that commit message, not specific issue references.)

@basayel
Copy link

basayel commented Nov 1, 2012

Thanks so much @bensomers I tried the improved-rack-throttle and it did the job .. I really hope the authors respond to the pull requests to have a single reference. The last commit had been 2 years ago

@artob artob self-assigned this Nov 14, 2014
@FreekingDean
Copy link
Collaborator

Cleaning up old Issues, this should be fixed as of #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants