forked from 0x2620/pandora
404 instead of error for invalid oembed requests
This commit is contained in:
parent
83df2c0011
commit
b0ece6a566
1 changed files with 4 additions and 1 deletions
|
@ -1289,12 +1289,15 @@ def atom_xml(request):
|
||||||
'application/atom+xml'
|
'application/atom+xml'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def oembed(request):
|
def oembed(request):
|
||||||
format = request.GET.get('format', 'json')
|
format = request.GET.get('format', 'json')
|
||||||
maxwidth = int(request.GET.get('maxwidth', 640))
|
maxwidth = int(request.GET.get('maxwidth', 640))
|
||||||
maxheight = int(request.GET.get('maxheight', 480))
|
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('/')
|
parts = urlparse(url).path.split('/')
|
||||||
if len(parts) < 2:
|
if len(parts) < 2:
|
||||||
raise Http404
|
raise Http404
|
||||||
|
|
Loading…
Reference in a new issue