mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Crystal 0.25.0 (#452)
This commit is contained in:
parent
c2236acf3a
commit
a5870e7d24
9 changed files with 23 additions and 22 deletions
|
@ -131,7 +131,7 @@ describe Kemal::StaticFileHandler do
|
|||
end
|
||||
|
||||
it "should handle setting custom headers" do
|
||||
headers = Proc(HTTP::Server::Response, String, File::Stat, Void).new do |response, path, stat|
|
||||
headers = Proc(HTTP::Server::Response, String, File::Info, Void).new do |response, path, stat|
|
||||
if path =~ /\.html$/
|
||||
response.headers.add("Access-Control-Allow-Origin", "*")
|
||||
end
|
||||
|
@ -143,7 +143,7 @@ describe Kemal::StaticFileHandler do
|
|||
response = handle HTTP::Request.new("GET", "/dir/test.txt")
|
||||
response.headers.has_key?("Access-Control-Allow-Origin").should be_false
|
||||
response.headers["Content-Size"].should eq(
|
||||
File.stat("#{__DIR__}/static/dir/test.txt").size.to_s
|
||||
File.info("#{__DIR__}/static/dir/test.txt").size.to_s
|
||||
)
|
||||
|
||||
response = handle HTTP::Request.new("GET", "/dir/index.html")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue