help / color / mirror / Atom feed
From: Ingo Schwarze <>
To: "Anthony J. Bentley" <>
Subject: Re: Content-Security-Policy for man.cgi
Date: Sun, 10 Nov 2019 21:57:11 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <1076-1573416545.590100@piVC.Y-1h.zrhB>

Hi Anthony,

Anthony J. Bentley wrote on Sun, Nov 10, 2019 at 01:09:05PM -0700:
> Ingo Schwarze writes:

>> I think completely getting rid of style= isn't that hard, but i won't
>> work too much on mandoc during a ports hackathon - so i have taken
>> a TODO note for now (see below).

> Then here's the new diff.

I have installed that diff on for testing, and my
impression is that it works as intended.  Maybe you want to have a
look at what that server now does, too, and if you are also satisfied,
feel free to commit it.

It may be only a few weeks until i come round to the style= cleanup,
but why not make it better in the meantime.

> (I removed the space after the semicolon as it's optional.)

Actually (bikeshed), i'd prefer to have that space 'none'; "
because it makes the header easier to read for humans (even
though i admit not as many humans as browsers may be in the
habit of reading HTTP headers), and for symmetry with the
line just above (before "charset").


> Index: cgi.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/mandoc/cgi.c,v
> retrieving revision 1.106
> diff -u -p -r1.106 cgi.c
> --- cgi.c	1 Oct 2019 17:54:04 -0000	1.106
> +++ cgi.c	10 Nov 2019 20:07:39 -0000
> @@ -336,6 +336,8 @@ resp_begin_http(int code, const char *ms
>  	printf("Content-Type: text/html; charset=utf-8\r\n"
>  	     "Cache-Control: no-cache\r\n"
> +	     "Content-Security-Policy: default-src 'none';"
> +	     "style-src 'self' 'unsafe-inline'\r\n"
>  	     "Pragma: no-cache\r\n"
>  	     "\r\n");
 To unsubscribe send an email to

      reply	other threads:[~2019-11-10 20:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-10  8:59 Anthony J. Bentley
2019-11-10 10:22 ` Ingo Schwarze
2019-11-10 13:02   ` Anthony J. Bentley
2019-11-10 17:47     ` Ingo Schwarze
2019-11-10 20:09       ` Anthony J. Bentley
2019-11-10 20:57         ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: Content-Security-Policy for man.cgi' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).