Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/browser/browser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,15 @@ pub const Page = struct {

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

const ct = header.get("content-type") orelse {
// no content type in HTTP headers.
// TODO try to sniff mime type from the body.
log.info("no content-type HTTP header", .{});
return;
const ct = blk: {
break :blk header.get("content-type") orelse {
// no content type in HTTP headers.
// TODO try to sniff mime type from the body.
log.info("no content-type HTTP header", .{});

// Assume it's HTML for now.
break :blk "text/html; charset=utf-8";
};
};

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