From ae52ff93b208d7c41d1ff70afd9d0c2c265d915d Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 13 Apr 2019 08:28:59 -0500 Subject: [PATCH] Fix 404 for annotations endpoint --- src/invidious.cr | 5 +++++ 1 file changed, 5 insertions(+) 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