summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-04-13 08:28:59 -0500
committerOmar Roth <omarroth@hotmail.com>2019-04-13 08:28:59 -0500
commitae52ff93b208d7c41d1ff70afd9d0c2c265d915d (patch)
treee59778dddcfabec138e2540dbf89f229d9e50fbc
parent80a567bf1ecaa4dc141294c426bf0a92638a1fd1 (diff)
downloadinvidious-ae52ff93b208d7c41d1ff70afd9d0c2c265d915d.tar.gz
invidious-ae52ff93b208d7c41d1ff70afd9d0c2c265d915d.tar.bz2
invidious-ae52ff93b208d7c41d1ff70afd9d0c2c265d915d.zip
Fix 404 for annotations endpoint
-rw-r--r--src/invidious.cr5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index bf552b42..ab3f1019 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -2921,6 +2921,11 @@ get "/api/v1/annotations/:id" do |env|
response = HTTP::Client.get(URI.parse(location.headers["Location"]))
+ if response.body.empty?
+ env.response.status_code = 404
+ next
+ end
+
if response.status_code != 200
env.response.status_code = response.status_code
next