mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
fix: word around to fix website return 404 with no response body
This commit is contained in:
parent
3bff15f385
commit
a409413f54
|
@ -32,6 +32,11 @@ void IframeSchemeHandler::requestStarted(QWebEngineUrlRequestJob *requestJob)
|
|||
// 404 response may have response body.
|
||||
if( reply->error() != QNetworkReply::NoError && articleString.isEmpty())
|
||||
{
|
||||
if(reply->error()==QNetworkReply::ContentNotFoundError){
|
||||
//work around to fix QTBUG-106573
|
||||
requestJob->redirect(url);
|
||||
return;
|
||||
}
|
||||
QString emptyHtml = QString( "<html><body>%1</body></html>" ).arg( reply->errorString() );
|
||||
buffer->setData( emptyHtml.toUtf8() );
|
||||
requestJob->reply( contentType, buffer );
|
||||
|
|
Loading…
Reference in a new issue