From 513110c6955fabc5269cf358dc2410a965642a16 Mon Sep 17 00:00:00 2001 From: Emanuel Dima Date: Mon, 7 Apr 2014 23:15:51 +0200 Subject: [PATCH] fixed #231: just return 404 when the URL is incorrect --- invenio/lib/websearch_webinterface.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/invenio/lib/websearch_webinterface.py b/invenio/lib/websearch_webinterface.py index 0bb919fbe1..eca02c2a11 100644 --- a/invenio/lib/websearch_webinterface.py +++ b/invenio/lib/websearch_webinterface.py @@ -715,16 +715,9 @@ def answer(req, form): recid = int(path[0]) else: recid = int(path[0]) - except IndexError: - # display record #1 for URL /CFG_SITE_RECORD without a number - recid = 1 - except ValueError: - if path[0] == '': - # display record #1 for URL /CFG_SITE_RECORD/ without a number - recid = 1 - else: - # display page not found for URLs like /CFG_SITE_RECORD/foo - return None, [] + except: + # 404 for /record/ and /record/foobarbaz + return None, [] from invenio.intbitset import __maxelem__ if recid <= 0 or recid > __maxelem__: