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

« back to all changes in this revision

Viewing changes to services/serveservice

  • 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:
139
139
    zipmod.make_zip(zipbasepath, paths, zipfile)
140
140
 
141
141
    print cjson.encode({'type': zip_mimetype,
142
 
                        'name': zipfilename})
 
142
                        'name': zipfilename.decode('utf-8')})
143
143
 
144
144
    stream = zipfile
145
145
    stream.seek(0)
146
146
else:
147
147
 
148
148
    print cjson.encode({'type': determine_file_type(filename),
149
 
                        'name': os.path.basename(filename)})
 
149
                        'name': os.path.basename(filename).decode('utf-8')})
150
150
    stream = open(filename)
151
151
    
152
152
next = stream.read(1024)