diff options
author | Ori Bernstein <ori@eigenstate.org> | 2021-06-12 14:32:16 +0000 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2021-06-12 14:32:16 +0000 |
commit | aacf368c6d4ec9adb9fae28d3ca07d074fd459f5 (patch) | |
tree | 7926906342bd0a2a127a3b302494b3e643e5f5e6 /sys/src/cmd/mothra/url.c | |
parent | af95aa431d6e511355a6eb953ab7845f94c0e2d7 (diff) |
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.
Diffstat (limited to 'sys/src/cmd/mothra/url.c')
-rw-r--r-- | sys/src/cmd/mothra/url.c | 3 |
1 files changed, 3 insertions, 0 deletions
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)); |