~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/serve/__init__.py

  • Committer: Matt Giuca
  • Date: 2010-02-18 09:18:15 UTC
  • Revision ID: matt.giuca@gmail.com-20100218091815-t5r1k9g8luwybvu3
serveservice and serve: Fixed download of non-ASCII-named files, by decoding filenames in serveservice (so they aren't mangled by JSON) and re-encoding them in the response headers (as you can't put unicode strings in the HTTP response). This is, as far as I can tell, the last outstanding non-ASCII filenames bug in IVLE, so I am closing bug #523500. Hooray.

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
                                     response['error'])
132
132
 
133
133
        if download:
134
 
            req.headers_out["Content-Disposition"] = \
135
 
                         "attachment; filename=%s" % response['name']
 
134
            req.headers_out["Content-Disposition"] = (
 
135
                         "attachment; filename=%s" %
 
136
                             response['name'].encode('utf-8'))
136
137
        req.content_type = response['type']
137
138
        req.write(out)
138
139