samuelneff / MimeTypeMap

Provides a huge dictionary of file extensions to mime types.
MIT License
622 stars 201 forks source link

Mime type not recognize #109

Closed JoseRodriguezLopez closed 3 years ago

JoseRodriguezLopez commented 4 years ago

Hi, I am having problems with extension "application/vnd.ms-outlook". I reviewed class MimeTypeMap.cs and it is there but for some reason I am getting an exception "Requested mime type is not registered: application/vnd.ms-outlook".

samuelneff commented 4 years ago

Can you share a short snippet of code? Did you copy and paste the error exactly or did you retype it into GitHub?

JoseRodriguezLopez commented 4 years ago

private static string GetExtension(string contentType) { return MimeTypes.MimeTypeMap.GetExtension(contentType); }

I confirm you that I copied and pasted the error from VS. Thanks in advance!

samuelneff commented 4 years ago

Where exactly does contentType come from? User provided? Do you get this error if you try other valid mime types?

samuelneff commented 4 years ago

Can you set a breakpoint inside GetExtension and see what the difference/issue is when stepping through?

JoseRodriguezLopez commented 4 years ago

image

JoseRodriguezLopez commented 4 years ago

The content type come from a web client response headers, specifically from the Content-Type. It works with other mime types , I am getting the error just with "application/vnd.ms-outlook."

samuelneff commented 3 years ago

I've thought about this issue a lot and am sorry to say I can't reproduce the issue or come up with an explanation or fix.