Crystal 0.25.0 (#452)

This commit is contained in:
Serdar Dogruyol 2018-06-16 18:03:00 +03:00 committed by GitHub
parent c2236acf3a
commit a5870e7d24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 22 deletions

View file

@ -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")