Skip to content

Commit

Permalink
arrange_contents: handle non-base64 values
Browse files Browse the repository at this point in the history
  • Loading branch information
Misty De Meo committed Aug 28, 2015
1 parent 4c91bd7 commit aa30f80
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/dashboard/src/components/filesystem_ajax/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ def contents(request):
def arrange_contents(request):
path = request.GET.get('path')
if path is not None:
base_path = base64.b64decode(path)
try:
base_path = base64.b64decode(path)
except TypeError:
response = {
'success': False,
'message': 'Could not base64-decoded provided path: ' + path,
}
helpers.json_response(response, status_code=400)
# Must indicate that base_path is a folder by ending with /
if not base_path.endswith('/'):
base_path += '/'
Expand Down

0 comments on commit aa30f80

Please sign in to comment.