diff options
author | defanor <defanor@uberspace.net> | 2020-01-06 04:18:59 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2020-01-06 04:18:59 +0300 |
commit | 1d4d4951b0a29bec71f4485e9ed1ce1621329fe9 (patch) | |
tree | 7909ce144fd9be9ae4200cd96bf4de6f8b2db642 /src/browserbox.c | |
parent | e35ff9bcddd7819b5110cfeb9acf2e727063090e (diff) |
Diffstat (limited to 'src/browserbox.c')
-rw-r--r-- | src/browserbox.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/browserbox.c b/src/browserbox.c index 595afb3..a4f1430 100644 --- a/src/browserbox.c +++ b/src/browserbox.c @@ -1313,8 +1313,11 @@ void got_headers(SoupMessage *msg, gpointer ptr) "response-headers", &smh, NULL); const char *ct = soup_message_headers_get_content_type(smh, NULL); - if (! (strcmp(ct, "text/html") == 0 || - strcmp(ct, "application/xhtml+xml") == 0)) { + if (ct == NULL) { + browser_box_set_status(bb, "Unknown content type"); + bb->builder_state->active = FALSE; + } else if (! (strcmp(ct, "text/html") == 0 || + strcmp(ct, "application/xhtml+xml") == 0)) { browser_box_set_status(bb, "Unsupported content type"); /* todo: offer to download a file */ bb->builder_state->active = FALSE; |