Skip to content

Commit

Permalink
Fix CSRF token cookie path
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDaugherty committed Sep 24, 2020
1 parent a9d1c4b commit bb31639
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/better_errors/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def show_error_page(env, exception=nil)
response = Rack::Response.new(content, status_code, { "Content-Type" => "text/#{type}; charset=utf-8" })

unless request.cookies[CSRF_TOKEN_COOKIE_NAME]
response.set_cookie(CSRF_TOKEN_COOKIE_NAME, value: csrf_token, httponly: true, same_site: :strict)
response.set_cookie(CSRF_TOKEN_COOKIE_NAME, value: csrf_token, path: "/", httponly: true, same_site: :strict)
end

# In older versions of Rack, the body returned here is actually a Rack::BodyProxy which seems to be a bug.
Expand Down

0 comments on commit bb31639

Please sign in to comment.