Sinatraã£ã¦ãããRackã®ããã«ã¦ã§ã¢ã§ããã¾ããã sudo gem install rack_csrf# app.rb require 'rubygems' require 'sinatra' require 'rack/csrf' get '/' do @msg = 'Hello World' erb :index end post '/' do @msg = 'Hello CSRF' erb :index end configure do set :app_file, __FILE__ use Rack::Session::Cookie, :secret => 'change me' use Rack::Csrf, :raise => true end helpers do def csrf_token Rack::Csrf.csrf_token(env) end def
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}