From b0ece6a566a686ce334aa02b1b4a4cb0e2a7efd3 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 12 Jul 2023 14:17:09 +0530 Subject: [PATCH] 404 instead of error for invalid oembed requests --- pandora/item/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index 7e9c390e..a36de175 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -1289,12 +1289,15 @@ def atom_xml(request): 'application/atom+xml' ) + def oembed(request): format = request.GET.get('format', 'json') maxwidth = int(request.GET.get('maxwidth', 640)) maxheight = int(request.GET.get('maxheight', 480)) - url = request.GET['url'] + url = request.GET.get('url') + if not url: + raise Http404 parts = urlparse(url).path.split('/') if len(parts) < 2: raise Http404