if not file:
raise fastapi.HTTPException(404, "Could not find debuginfo in %s" % package)
+ headers = {
+ # XXX This should set Content-Length
+ "Content-Type" : file.mimetype or "application/octet-stream",
+ }
+
# Stream the payload
- return fastapi.responses.StreamingResponse(
- file.stream(), media_type="application/octet-stream")
+ return fastapi.responses.StreamingResponse(file.stream(), headers=headers)
# XXX Check if this is actually downloadable
headers = {
+ "Content-Type" : file.mimetype or "application/octet-stream",
"Content-Disposition" : "attachment; filename=%s" % file.basename,
# XXX StreamingResponse does not allow us to set a Content-Length header
"X-Robots-Tag" : "noindex",
}
- return fastapi.responses.StreamingResponse(
- file.stream(), media_type=file.mimetype, headers=headers,
- )
+ return fastapi.responses.StreamingResponse(file.stream(), headers=headers)
# Add everything to the APIv1