fix 500 error when file extension could not be guessed #79
Loading…
Reference in New Issue
No description provided.
Delete Branch "jonas-w/0x0:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When a file without an extension was uploaded, and the mimetypes.guess_extension returned None, because there is no official file extension for that mimetype, a NoneType was subscripted, which yielded a 500 http error.
This ironically happened when i tried to upload my 0x0 uploader python script, which had no python extension and
text/x-script.python
is no official IANA mime type thats why guess_extension won't return a .py extension butNone
.My fix is to first check if the guess is None and if it is none, then ext will be set to an empty string, so that it falls back to '.bin' in the return statement.
93f52a14d2
to3950f6e8eb
Oh, thanks! Think this one might have be a regression.
Should now be fixed on the 0x0.st instance as well.
Feel free to also extend the tests for this. I haven’t gotten around to extending the test suite yet… 😅
Wow that was fast!
if i stumble on more bugs while developing my 0x0 cli (struggling with finding a name) i will definitely let you know and probably fix them 😊