From e75be46cace4f0c1f2b93b0ccf985854ba6b425a Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 18 Aug 2021 06:53:06 +0300 Subject: DocumentWidget: Incorrect message in Page Info --- src/ui/documentwidget.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 703d1d13..f746c123 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1860,7 +1860,12 @@ static void checkResponse_DocumentWidget_(iDocumentWidget *d) { updateTrust_DocumentWidget_(d, resp); init_Anim(&d->sideOpacity, 0); init_Anim(&d->altTextOpacity, 0); - format_String(&d->sourceHeader, "%d %s", statusCode, get_GmError(statusCode)->title); + format_String(&d->sourceHeader, + "%d %s", + statusCode, + isEmpty_String(&resp->meta) && !isSuccess_GmStatusCode(statusCode) + ? get_GmError(statusCode)->title + : cstr_String(&resp->meta)); d->sourceStatus = statusCode; switch (category_GmStatusCode(statusCode)) { case categoryInput_GmStatusCode: { @@ -2770,14 +2775,12 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) id_GmRequest(d->request) == argU32Label_Command(cmd, "reqid")) { set_Block(&d->sourceContent, body_GmRequest(d->request)); if (!isSuccess_GmStatusCode(status_GmRequest(d->request))) { + /* TODO: Why is this here? Can it be removed? */ format_String(&d->sourceHeader, "%d %s", status_GmRequest(d->request), cstr_String(meta_GmRequest(d->request))); } - else { - clear_String(&d->sourceHeader); - } updateFetchProgress_DocumentWidget_(d); checkResponse_DocumentWidget_(d); if (category_GmStatusCode(status_GmRequest(d->request)) == categorySuccess_GmStatusCode) { -- cgit v1.2.3