Closed HalosGhost closed 9 years ago
Needs testcase or example.
If, for example, you navigate to this paste in Firefox, you will see the following:
If, instead, you navigate to the same paste with a file extension specified (note that you can give it an incorrect file extension), you will find this:
Ahh. Not a bug. It's intended that you override the default text/plain with your extension, because doing it this way is fast and simple to implement.
Otherwise, it's possible to libmagic the body on every GET (or calculate this once and store the result in the db).
So uh.. how do you want this to work exactly?
If you -F @c=foo.jpg
right now, you get <shortid>.jpg
back. Would you rather I also set the 'default' mimetype for <shortid>
to jpg for that paste as well?
I think that using libmagic on every GET
seems like a sadtime; but using it once and storing it (probably on upload so that it handles paste updating fine) seems like it'd be a good idea (since it would gracefully handle stdin cases).
Does that make sense to you?
Yep.
Great! I look forward to the implementation!
3ca079ad0ed0cbdbe715eab44f462648e0dc61b9
note that you can give it an incorrect file extension
Not a bug.
An image paste loaded in Firefox without an extension added to the end of the id will not correctly display (instead, the binary data will be output).