Closed xmedr closed 4 months ago
This still errors out when the content-disposition is None
, but the command would still continue to run. I imagine this can return something more useful in that case, but was unsure what that would be since no content would mean no file. What do you think @fgregg?
@xmedr let's do something like
content_disposition = headers.get("Content-Disposition")
if content_disposition:
_, params = cgi.parse_header(content_disposition)
filename = params["filename"]
media_ext = os.path.splitext(filename)[1]
else:
media_ext = ""
awesome, ty for those suggestions i've got them in!
Overview
All of the
content-dispositions
when looking for filenames as of late have been either of typestr
orNone
. So thedecode()
method that has been in use has been raisingAttributeErrors
. This branch accounts for thecontent-disposition
being a string, and passes the filename found within.After resolving that error,
jq
had issues parsing out thefiles
attributes of objects infiling.json
to a csv since they were nested objects. This branch also flattens out that object with a make command to get the csv working.Testing Instructions
make lm20.db
or look at the checks performed on this PR