mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Remove basic auth middleware
This commit is contained in:
parent
13293a675d
commit
b4c10a3f59
4 changed files with 0 additions and 79 deletions
|
@ -1,28 +0,0 @@
|
|||
require "../spec_helper"
|
||||
|
||||
describe "Kemal::Middleware::HTTPBasicAuth" do
|
||||
it "goes to next handler with correct credentials" do
|
||||
auth_handler = Kemal::Middleware::HTTPBasicAuth.new("serdar", "123")
|
||||
request = HTTP::Request.new(
|
||||
"GET",
|
||||
"/",
|
||||
headers: HTTP::Headers{"Authorization" => "Basic c2VyZGFyOjEyMw=="},
|
||||
)
|
||||
|
||||
io_with_context = create_request_and_return_io(auth_handler, request)
|
||||
client_response = HTTP::Client::Response.from_io(io_with_context, decompress: false)
|
||||
client_response.status_code.should eq 404
|
||||
end
|
||||
|
||||
it "returns 401 with incorrect credentials" do
|
||||
auth_handler = Kemal::Middleware::HTTPBasicAuth.new("serdar", "123")
|
||||
request = HTTP::Request.new(
|
||||
"GET",
|
||||
"/",
|
||||
headers: HTTP::Headers{"Authorization" => "NotBasic"},
|
||||
)
|
||||
io_with_context = create_request_and_return_io(auth_handler, request)
|
||||
client_response = HTTP::Client::Response.from_io(io_with_context, decompress: false)
|
||||
client_response.status_code.should eq 401
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue