Open lpar opened 4 years ago
I just had a problem that mime type wasn't detected by a file extension but was sniffed instead. This is a well known problem for the golang http package and you can't do anything about it. I solved the problem myself by registering a mime type of the file extension:
_ = mime.AddExtensionType(".ndjson", "application/x-ndjson")
Turning part of #16 into a standalone item.
I'm not a big fan of content sniffing, as it can lead to really obscure bugs. However, it wouldn't be all that hard to read a chunk from the uncompressed version of the file, and call http.DetectContentType to pick a MIME type.