Skip to content

Commit 1d97d61

Browse files
krichprollschsjorsdonkers
authored andcommitted
browser: assume no-content type is html
1 parent ba6701d commit 1d97d61

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/browser/browser.zig

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,15 @@ pub const Page = struct {
395395

396396
log.info("GET {any} {d}", .{ self.uri, header.status });
397397

398-
const ct = header.get("content-type") orelse {
399-
// no content type in HTTP headers.
400-
// TODO try to sniff mime type from the body.
401-
log.info("no content-type HTTP header", .{});
402-
return;
398+
const ct = blk: {
399+
break :blk header.get("content-type") orelse {
400+
// no content type in HTTP headers.
401+
// TODO try to sniff mime type from the body.
402+
log.info("no content-type HTTP header", .{});
403+
404+
// Assume it's HTML for now.
405+
break :blk "text/html; charset=utf-8";
406+
};
403407
};
404408

405409
log.debug("header content-type: {s}", .{ct});

0 commit comments

Comments
 (0)