rack/rack-attack

Request Headers

CarlosUvaSilva opened this issue · 0 comments

I'm creating a SASS and I'd like to throttle based on the client's Auth-Token

This token is based on the request's headers but I can't access those headers, is that even possible?

throttle('req/token', limit: 1, period: 1.minute) do |req|
    req.header
end

req.header throws an error. I read in another issue that req.get_header('Auth-Token') should work but I always get nil

EDIT: I can't access my POST params either. Am I missing some config?
thanks