Help clients with the output of GET /datasets/<id>/inventory/ by "tuning" the Content-Disposition header automatically generated by Werkzeug's send_file API.
I started thinking I would construct the header and looking into how to add headers to the Response object constructed by send_file. It actually does a good job of guessing the filename, but I decided to help it by providing the name we want, and I'm designating the raw tarfile as an attachment that we can't reasonably expect a client (especially the UI) to do anything with "inline" (the default).
PBENCH-1169
Help clients with the output of
GET /datasets/<id>/inventory/
by "tuning" theContent-Disposition
header automatically generated by Werkzeug'ssend_file
API.I started thinking I would construct the header and looking into how to add headers to the
Response
object constructed bysend_file
. It actually does a good job of guessing the filename, but I decided to help it by providing the name we want, and I'm designating the raw tarfile as anattachment
that we can't reasonably expect a client (especially the UI) to do anything with "inline" (the default).