From aacf368c6d4ec9adb9fae28d3ca07d074fd459f5 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Sat, 12 Jun 2021 14:32:16 +0000 Subject: mothra: read the content-type header over file(1) to determine type (thanks james palmer) this fixes some pages being classified as xml by file(1), meaning they would be rendered as plain text rather than as html. --- sys/src/cmd/mothra/url.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys/src/cmd/mothra/url.c') diff --git a/sys/src/cmd/mothra/url.c b/sys/src/cmd/mothra/url.c index 2e0e659ca..69e9d9a7f 100644 --- a/sys/src/cmd/mothra/url.c +++ b/sys/src/cmd/mothra/url.c @@ -215,6 +215,9 @@ urlget(Url *url, int body) snprint(buf+n, sizeof(buf)-n, "/parsed/fragment"); readstr(buf, url->tag, sizeof(url->tag)); + + snprint(buf+n, sizeof(buf)-n, "/contenttype"); + readstr(buf, url->contenttype, sizeof(url->contenttype)); snprint(buf+n, sizeof(buf)-n, "/contentencoding"); readstr(buf, buf, sizeof(buf)); -- cgit v1.2.3