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:
@@ -57,6 +57,11 @@ BFileRequest::_ProtocolLoop()
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
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
|
// Send all notifications to listener, if any
|
||||||
if (fListener != NULL) {
|
if (fListener != NULL) {
|
||||||
fListener->ConnectionOpened(this);
|
fListener->ConnectionOpened(this);
|
||||||
@@ -77,11 +82,6 @@ BFileRequest::_ProtocolLoop()
|
|||||||
fListener->DownloadProgress(this, size, size);
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user