Format
This commit is contained in:
parent
6ffa4af0e1
commit
4edebcf8eb
6 changed files with 12 additions and 13 deletions
|
@ -54,7 +54,7 @@ describe "Context" do
|
|||
key: env.get("key"),
|
||||
before_get: env.get("before_get"),
|
||||
before_get_int: env.get("before_get_int"),
|
||||
before_get_float: env.get("before_get_float")
|
||||
before_get_float: env.get("before_get_float"),
|
||||
}
|
||||
end
|
||||
request = HTTP::Request.new("GET", "/")
|
||||
|
|
|
@ -74,7 +74,7 @@ describe "Macros" do
|
|||
env.response.headers.add "Content-Type", "image/png"
|
||||
headers env, {
|
||||
"Access-Control-Allow-Origin" => "*",
|
||||
"Content-Type" => "text/plain"
|
||||
"Content-Type" => "text/plain",
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -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", "/")
|
||||
|
@ -55,7 +54,7 @@ describe "Kemal::Middleware::CSRF" do
|
|||
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 })
|
||||
"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
|
||||
|
|
|
@ -166,7 +166,7 @@ describe "Kemal::RouteHandler" do
|
|||
end
|
||||
|
||||
it "sets X-Powered-By to Kemal" do
|
||||
get "/" {}
|
||||
get "/" { }
|
||||
request = HTTP::Request.new("GET", "/")
|
||||
client_response = call_request_on_app(request)
|
||||
client_response.headers["X-Powered-By"].should eq("Kemal")
|
||||
|
|
Loading…
Reference in a new issue