Skip to content

Commit

Permalink
Fixed broken image serving in development server
Browse files Browse the repository at this point in the history
  • Loading branch information
crohkohl committed Aug 7, 2015
1 parent cb7ff66 commit c9ce72d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions digits/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,8 @@ def serve_file(path):
raise werkzeug.exceptions.NotFound('File not found')
if os.path.isdir(path):
raise werkzeug.exceptions.Forbidden('Folder cannot be served')

with open(path, 'r') as infile:
response = flask.make_response(infile.read())
response.headers["Content-Disposition"] = "attachment; filename=%s" % os.path.basename(path)
return response

return flask.send_file(path)

### Path Completion

Expand Down

0 comments on commit c9ce72d

Please sign in to comment.