mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Fix content-type for HEAD '.jpg'
This commit is contained in:
parent
094143bc28
commit
bba80bc80f
2 changed files with 6 additions and 1 deletions
|
@ -5168,7 +5168,7 @@ get "/sb/:id/:storyboard/:index" do |env|
|
||||||
env.response.headers[key] = value
|
env.response.headers[key] = value
|
||||||
end
|
end
|
||||||
|
|
||||||
if response.status_code == 304
|
if response.status_code >= 400
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,11 @@ class Kemal::RouteHandler
|
||||||
raise Kemal::Exceptions::CustomException.new(context)
|
raise Kemal::Exceptions::CustomException.new(context)
|
||||||
end
|
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.response.print(content)
|
||||||
context
|
context
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue