From 08a90c8a510e1d5de1ba3ac44a28f83a0d7f278d Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Wed, 9 Aug 2017 01:31:20 +0000 Subject: [PATCH] Handle 404 fetch if the channel id doesnt exist --- webapp/titanembeds/blueprints/api/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index 11a315e..43918ff 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -333,6 +333,8 @@ def fetch(): session['user_keys'].pop(guild_id, None) else: chan = filter_guild_channel(guild_id, channel_id) + if not chan: + abort(404) if not chan.get("read"): status_code = 401 else: @@ -352,6 +354,8 @@ def fetch_visitor(): abort(403) messages = {} chan = filter_guild_channel(guild_id, channel_id, True) + if not chan: + abort(404) if not chan.get("read"): status_code = 401 else: