browser: don't stop processing page on error status code

This commit is contained in:
Pierre Tachoire
2024-12-13 11:56:18 +01:00
parent 3b018e2a6d
commit f9da815e8f

View File

@@ -276,18 +276,15 @@ pub const Page = struct {
const req = resp.req; const req = resp.req;
log.info("GET {any} {d}", .{ self.uri, req.response.status }); log.info("GET {any} {d}", .{ self.uri, @intFromEnum(req.response.status) });
// TODO handle redirection // TODO handle redirection
if (req.response.status != .ok) {
log.debug("{?} {d} {s}", .{ log.debug("{?} {d} {s}", .{
req.response.version, req.response.version,
req.response.status, @intFromEnum(req.response.status),
req.response.reason, req.response.reason,
// TODO log headers // TODO log headers
}); });
return error.BadStatusCode;
}
// TODO handle charset // TODO handle charset
// https://html.spec.whatwg.org/#content-type // https://html.spec.whatwg.org/#content-type