diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-08-07 10:01:46 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-08-07 10:01:46 -0500 |
| commit | a5fb1d38e04298a6dfd8b4851052091db04d628f (patch) | |
| tree | c69b7da930149998aaceda9b775dc0279c34ca84 | |
| parent | 187fa11c4afc9192575f822e1f127bbd0de57f4e (diff) | |
| download | invidious-a5fb1d38e04298a6dfd8b4851052091db04d628f.tar.gz invidious-a5fb1d38e04298a6dfd8b4851052091db04d628f.tar.bz2 invidious-a5fb1d38e04298a6dfd8b4851052091db04d628f.zip | |
Fix non-existent 'content_html' on empty comment section
| -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 30a27058..ce518a08 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -1708,7 +1708,12 @@ get "/api/v1/comments/:id" do |env| ctoken = body.match(/'COMMENTS_TOKEN': "(?<ctoken>[^"]+)"/) if !ctoken env.response.content_type = "application/json" + + if format == "json" next {"comments" => [] of String}.to_json + else + next {"content_html" => ""}.to_json + end end ctoken = ctoken["ctoken"] itct = body.match(/itct=(?<itct>[^"]+)"/).not_nil!["itct"] |
