Skip to content

Commit

Permalink
Fix QA issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ellmetha committed Oct 27, 2024
1 parent c08f0dd commit 53596dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe Marten::Handlers::RequestForgeryProtection do
response.status.should eq 200
end

it "allows #{unsafe_method} requests if the csrftoken data parameter is specified and matches the CSRF token cookie" do
it "allows #{unsafe_method} requests if the csrftoken data parameter matches the CSRF token cookie" do
token = Marten::Handlers::RequestForgeryProtectionSpec::EXAMPLE_MASKED_SECRET_1

raw_request = ::HTTP::Request.new(
Expand All @@ -130,7 +130,7 @@ describe Marten::Handlers::RequestForgeryProtection do
response.status.should eq 200
end

it "allows #{unsafe_method} requests if the csrftoken data parameter is specified and matches the sessions CSRF token" do
it "allows #{unsafe_method} requests if the csrftoken data parameter matches the sessions CSRF token" do
session_store = Marten::HTTP::Session::Store::Cookie.new("sessionkey")
Marten.settings.csrf.use_session = true

Expand Down
1 change: 0 additions & 1 deletion src/marten/handlers/concerns/request_forgery_protection.cr
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ module Marten
return reject("CSRF token is missing")
end

request_csrf_token = nil
request_csrf_token = request.data.fetch(CSRF_TOKEN_REQUEST_DATA_NAME, nil)
request_csrf_token = request.headers[CSRF_TOKEN_HEADER_NAME]? if request_csrf_token.nil?

Expand Down

0 comments on commit 53596dd

Please sign in to comment.