diff options
| author | Omar Roth <omarroth@hotmail.com> | 2019-04-13 08:28:59 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2019-04-13 08:28:59 -0500 |
| commit | ae52ff93b208d7c41d1ff70afd9d0c2c265d915d (patch) | |
| tree | e59778dddcfabec138e2540dbf89f229d9e50fbc /src | |
| parent | 80a567bf1ecaa4dc141294c426bf0a92638a1fd1 (diff) | |
| download | invidious-ae52ff93b208d7c41d1ff70afd9d0c2c265d915d.tar.gz invidious-ae52ff93b208d7c41d1ff70afd9d0c2c265d915d.tar.bz2 invidious-ae52ff93b208d7c41d1ff70afd9d0c2c265d915d.zip | |
Fix 404 for annotations endpoint
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious.cr | 5 |
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 |
