FileRequest: set the mime type early.

WebKit may use the MIME type during incremental loading, so we better
set it before we start feeding the data.
This commit is contained in:
Adrien Destugues
2014-01-19 12:09:52 +01:00
parent 32da3d9dae
commit 7e433e7cad
+5 -5
View File
@@ -57,6 +57,11 @@ BFileRequest::_ProtocolLoop()
if (error != B_OK)
return error;
BNodeInfo info(&file);
char mimeType[B_MIME_TYPE_LENGTH + 1];
if (info.GetType(mimeType) == B_OK)
fResult.SetContentType(mimeType);
// Send all notifications to listener, if any
if (fListener != NULL) {
fListener->ConnectionOpened(this);
@@ -77,11 +82,6 @@ BFileRequest::_ProtocolLoop()
fListener->DownloadProgress(this, size, size);
}
BNodeInfo info(&file);
char mimeType[B_MIME_TYPE_LENGTH + 1];
if (info.GetType(mimeType) == B_OK)
fResult.SetContentType(mimeType);
return B_OK;
}