Вопрос по session, ruby-on-rails-3 – Запретить создание сессии на рельсах 3.2.2 для API RESTful

12

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceededstackoverflow.com/questions/4003667/… Viktor Trón
Error: User Rate Limit Exceededgithub.com/kares/session_offError: User Rate Limit Exceeded refaelos
Error: User Rate Limit Exceededstackoverflow.com/questions/1275008/… Viktor Trón

Ваш Ответ

4   ответа
-3

3

resource = warden.authenticate!(:scope => resource_name, :store => is_navigational_format?)
16

resource = warden.authenticate!(:scope => resource_name, :store => !(request.format.xml? || request.format.json?))

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded refaelos
1

Error: User Rate Limit Exceeded

# application_controller.rb
session :off, :if => :sessionless_request?

protected

def sessionless_request?(request)
  request.format == :xml || request.format == :json
end 

Error: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded refaelos
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded refaelos
Error: User Rate Limit Exceeded refaelos

Похожие вопросы