cog
9cd4738d - Support custom filename to be provided to URLFile (#2004)

Commit
1 year ago
Support custom filename to be provided to URLFile (#2004) This commit works around an issue where the basename of the URL many not actually contain a file extension and the uploader logic cannot infer the mime type for the file. We stash the name when pickling and extract it again when unpickling. The __getattr__ function then supports returning the underlying name value rather than proxying to the underlying request object. I also ran into a small bug whereby the __del__ method was triggering a network request because of some private attributes being accessed during teardown would trigger the __wrapper__ code. I've overridden the super class to disable this. Though I'm unclear if this is just the test suite doing this cleanup.
Author
Parents
Loading