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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user