FileRequest: identify unknown files.

* WebKit testsuite relies on the MIME types being correct, so when the
file doesn't have one, try to identify it.
* May be useful for other apps using FileRequest, anyway.
This commit is contained in:
Adrien Destugues
2014-04-10 08:51:00 +02:00
parent a8d8e823ea
commit f325986993
@@ -59,6 +59,8 @@ BFileRequest::_ProtocolLoop()
BNodeInfo info(&file);
char mimeType[B_MIME_TYPE_LENGTH + 1];
if (info.GetType(mimeType) != B_OK)
update_mime_info(fUrl.Path().String(), false, true, false);
if (info.GetType(mimeType) == B_OK)
fResult.SetContentType(mimeType);