Skip to content

Commit

Permalink
[#808] Fix Unicode url from causing a 500 now returns 404 as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Apr 24, 2013
1 parent 8d51a5a commit 290e594
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckan/controllers/template.py
Expand Up @@ -29,11 +29,11 @@ def view(self, url):
"""
try:
return base.render(url)
except TemplateNotFound:
except (TemplateNotFound, UnicodeEncodeError):
if url.endswith('.html'):
base.abort(404)
url += '.html'
try:
return base.render(url)
except TemplateNotFound:
except (TemplateNotFound, UnicodeEncodeError):
base.abort(404)

0 comments on commit 290e594

Please sign in to comment.