diff options
| author | Omar Roth <omarroth@protonmail.com> | 2019-05-03 08:23:11 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2019-05-03 08:23:11 -0500 |
| commit | bba80bc80f5408af9ab8a3708d44712b8df4d701 (patch) | |
| tree | 276f4792b556c6783907c854745c0f0e5bc9fdfc | |
| parent | 094143bc28624b0e95d8f586cdf663ffa151b06e (diff) | |
| download | invidious-bba80bc80f5408af9ab8a3708d44712b8df4d701.tar.gz invidious-bba80bc80f5408af9ab8a3708d44712b8df4d701.tar.bz2 invidious-bba80bc80f5408af9ab8a3708d44712b8df4d701.zip | |
Fix content-type for HEAD '.jpg'
| -rw-r--r-- | src/invidious.cr | 2 | ||||
| -rw-r--r-- | src/invidious/helpers/handlers.cr | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 1399c124..1603f4e6 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -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 diff --git a/src/invidious/helpers/handlers.cr b/src/invidious/helpers/handlers.cr index 560ed670..98087ec7 100644 --- a/src/invidious/helpers/handlers.cr +++ b/src/invidious/helpers/handlers.cr @@ -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 |
