global csrf

This commit is contained in:
julien committed 2026-10-22 19:33:34 +02:00
1 parent 82f8b28353
commit 42a9218df4
2 files changed
+2 -3

No files matched your search

+2 -1
View File
@@ -9,7 +9,7 @@ class Netig < Roda
plugin :public plugin :public
plugin :default_headers, "Content-Type" => "text/html; charset=utf-8" plugin :default_headers, "Content-Type" => "text/html; charset=utf-8"
plugin :sessions, secret: ENV.fetch("SESSION_SECRET") plugin :sessions, secret: ENV.fetch("SESSION_SECRET")
plugin :route_csrf plugin :route_csrf, csrf_failure: :empty_403
plugin :hash_branches plugin :hash_branches
plugin :flash plugin :flash
@@ -17,6 +17,7 @@ class Netig < Roda
route do |r| route do |r|
r.public r.public
check_csrf!
r.hash_branches r.hash_branches
r.root do r.root do
-2
View File
@@ -11,8 +11,6 @@ class Netig
end end
r.post "send" do r.post "send" do
check_csrf!
form = ContactForm.new(r.params) form = ContactForm.new(r.params)
if form.spam? if form.spam?