Use application/octet-stream for downloadable databses

I'd also like to send the Content-Length here but that's not currently
possible in Sanic - see bug report here:

https://github.com/channelcat/sanic/issues/1194
cleaner-link-column-pass-tests
Simon Willison 2018-04-17 17:31:54 -07:00
rodzic 1f384e662b
commit 5ebc7137d7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 17E2DEA2588B7F52
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -457,9 +457,9 @@ class DatabaseDownload(BaseView):
async def view_get(self, request, name, hash, **kwargs):
filepath = self.ds.inspect()[name]['file']
return await response.file_stream(
filepath, headers={
'Content-Disposition': 'attachment; filename="{}"'.format(filepath)
}
filepath,
filename=os.path.basename(filepath),
mime_type='application/octet-stream',
)