9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] file(1) another partial revert of 8419
@ 2021-05-03 18:38 theinicke
  2021-05-04 13:02 ` kvik
  0 siblings, 1 reply; 3+ messages in thread
From: theinicke @ 2021-05-03 18:38 UTC (permalink / raw)
  To: 9front

Hi,

given the revert in 8432, I think we should revert a little further.
Currently files like https://www.openbsd.org/anoncvs.html
are not rendered in mothra(1):

diff -r f98f914bcb45 sys/src/cmd/file.c
--- a/sys/src/cmd/file.c	Sat May 01 15:33:31 2021 -0400
+++ b/sys/src/cmd/file.c	Mon May 03 20:33:12 2021 +0200
@@ -855,7 +855,7 @@
 	"%PDF",			"PDF",				4,	"application/pdf",
 	"<!DOCTYPE",		"HTML file",			9,	"text/html",
 	"<!doctype",		"HTML file",			9,	"text/html",
-	"<!--",			"XML file",			4,	"text/xml",
+	"<!--",			"HTML file",			4,	"text/html",
 	"<html>",		"HTML file",			6,	"text/html",
 	"<HTML>",		"HTML file",			6,	"text/html",
 	"<?xml",		"HTML file",			5,	"text/html",



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] file(1) another partial revert of 8419
  2021-05-03 18:38 [9front] file(1) another partial revert of 8419 theinicke
@ 2021-05-04 13:02 ` kvik
  2021-05-04 17:21   ` james palmer
  0 siblings, 1 reply; 3+ messages in thread
From: kvik @ 2021-05-04 13:02 UTC (permalink / raw)
  To: 9front

> Currently files like https://www.openbsd.org/anoncvs.html
> are not rendered in mothra(1):

That page sets content-type, so why does mothra file(1) it?

I'd prefer to have file(1) try a bit harder to detect actual HTML
rather than reverting to an equally dumb classification.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] file(1) another partial revert of 8419
  2021-05-04 13:02 ` kvik
@ 2021-05-04 17:21   ` james palmer
  0 siblings, 0 replies; 3+ messages in thread
From: james palmer @ 2021-05-04 17:21 UTC (permalink / raw)
  To: 9front mailing list

Quoth kvik@a-b.xyz:
> > Currently files like https://www.openbsd.org/anoncvs.html
> > are not rendered in mothra(1):
> 
> That page sets content-type, so why does mothra file(1) it?
> 
> I'd prefer to have file(1) try a bit harder to detect actual HTML
> rather than reverting to an equally dumb classification.

a quick grep through mothra's source shows it only uses file(1). the filetype function needs to know about the content-type header but at the moment it just gets the fd and a buffer to put the mime type in.

- james

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-04 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03 18:38 [9front] file(1) another partial revert of 8419 theinicke
2021-05-04 13:02 ` kvik
2021-05-04 17:21   ` james palmer

9front - general discussion about 9front

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/9front

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9front 9front/ http://inbox.vuxu.org/9front \
		9front@9front.org
	public-inbox-index 9front

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9front


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git