Skip to content

Commit

Permalink
fixed EUDAT-B2SHARE#231: just return 404 when the URL is incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
emanueldima committed Apr 7, 2014
1 parent 652095c commit 513110c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions invenio/lib/websearch_webinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__:
Expand Down

0 comments on commit 513110c

Please sign in to comment.