mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Format
This commit is contained in:
parent
6ffa4af0e1
commit
4edebcf8eb
6 changed files with 12 additions and 13 deletions
|
@ -1,7 +1,6 @@
|
|||
require "../spec_helper"
|
||||
|
||||
describe "Kemal::Middleware::CSRF" do
|
||||
|
||||
it "sends GETs to next handler" do
|
||||
handler = Kemal::Middleware::CSRF.new
|
||||
request = HTTP::Request.new("GET", "/")
|
||||
|
@ -33,7 +32,7 @@ describe "Kemal::Middleware::CSRF" do
|
|||
request = HTTP::Request.new("POST", "/",
|
||||
body: "authenticity_token=#{current_token}&hasan=lamec",
|
||||
headers: HTTP::Headers{"Content-Type" => "application/x-www-form-urlencoded",
|
||||
"Set-Cookie" => client_response.headers["Set-Cookie"]})
|
||||
"Set-Cookie" => client_response.headers["Set-Cookie"]})
|
||||
io, context = process_request(handler, request)
|
||||
client_response = HTTP::Client::Response.from_io(io, decompress: false)
|
||||
client_response.status_code.should eq 404
|
||||
|
@ -54,8 +53,8 @@ describe "Kemal::Middleware::CSRF" do
|
|||
request = HTTP::Request.new("POST", "/",
|
||||
body: "hasan=lamec",
|
||||
headers: HTTP::Headers{"Content-Type" => "application/x-www-form-urlencoded",
|
||||
"Set-Cookie" => client_response.headers["Set-Cookie"],
|
||||
"x-csrf-token" => current_token })
|
||||
"Set-Cookie" => client_response.headers["Set-Cookie"],
|
||||
"x-csrf-token" => current_token})
|
||||
io, context = process_request(handler, request)
|
||||
client_response = HTTP::Client::Response.from_io(io, decompress: false)
|
||||
client_response.status_code.should eq 404
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue