나는 같은 문제가 있었지만 페이지 캐시 된 페이지가있었습니다. 오래된 인증 토큰과 위조 시도로 인식되는 post / put / delete 메소드를 사용하는 모든 작업으로 페이지가 버퍼링되었습니다. 오류 (422 처리 할 수없는 엔티티)가 사용자에게 리턴되었습니다.
Rails 3 솔루션 :
추가 :
skip_before_filter :verify_authenticity_token
또는 Rails 4에서 "sagivo"가 지적한대로 다음을 추가하십시오.
skip_before_action :verify_authenticity_token
캐싱을 수행하는 페이지에서.
@toobulkeh은 주석으로이상의 취약점이 아닌 :index, :show행동 만에이를 사용하여 조심 :put, :post행동.
예를 들면 다음과 같습니다.
caches_page :index, :show
skip_before_filter :verify_authenticity_token, :only => [:index, :show]
참조 : http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html
skip_before_action에 찬성하여 barlop- Rails 4.2에 의해 사용되지 않는 skip_before_filter https://guides.rubyonrails.org/4_2_release_notes.html "* _filter 메소드 계열은 문서에서 제거되었습니다. * _action에 대해서는 사용을 권장하지 않습니다. 방법 군 "
들어 레일 6 사용할 수있는 ( "collimarco"는 지적) skip_forgery_protection하고 세션 데이터를 사용하지 않는 REST API를 위해 그것을 사용하는 것이 안전하다는 것을.