Fix content-type for HEAD '.jpg'

このコミットが含まれているのは:
Omar Roth 2019-05-03 08:23:11 -05:00
コミット bba80bc80f
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: B8254FB7EC3D37F2
2個のファイルの変更6行の追加1行の削除

ファイルの表示

@ -5168,7 +5168,7 @@ get "/sb/:id/:storyboard/:index" do |env|
env.response.headers[key] = value
end
if response.status_code == 304
if response.status_code >= 400
break
end

ファイルの表示

@ -33,6 +33,11 @@ class Kemal::RouteHandler
raise Kemal::Exceptions::CustomException.new(context)
end
if context.request.method == "HEAD" &&
context.request.path.ends_with? ".jpg"
context.response.headers["Content-Type"] = "image/jpeg"
end
context.response.print(content)
context
end