Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BEFC211219 for ; Sun, 18 May 2014 05:50:37 +0000 (UTC) Received: (qmail 14008 invoked by uid 500); 18 May 2014 05:50:32 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 4350 invoked by uid 500); 18 May 2014 05:25:31 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 92717 invoked by uid 99); 18 May 2014 05:02:48 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 May 2014 05:02:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A495292E738; Sun, 18 May 2014 05:02:47 +0000 (UTC) From: kxepal To: dev@couchdb.apache.org Reply-To: dev@couchdb.apache.org References: In-Reply-To: Subject: [GitHub] couchdb pull request: Add Experimental Content-Security-Policy-Sup... Content-Type: text/plain Message-Id: <20140518050247.A495292E738@tyr.zones.apache.org> Date: Sun, 18 May 2014 05:02:47 +0000 (UTC) Github user kxepal commented on a diff in the pull request: https://github.com/apache/couchdb/pull/233#discussion_r12772196 --- Diff: src/couchdb/couch_httpd_misc_handlers.erl --- @@ -79,6 +80,15 @@ handle_utils_dir_req(#httpd{method='GET'}=Req, DocumentRoot) -> handle_utils_dir_req(Req, _) -> send_method_not_allowed(Req, "GET,HEAD"). +maybe_add_csp_headers(Headers, "false") -> + Headers; +maybe_add_csp_headers(Headers, "true") -> + DefaultValues = "default-src 'self'; img-src *; font-src *; " ++ + "script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline';", + Value = couch_config:get("csp", "header_value", DefaultValues), + Headers ++ [{"Content-Security-Policy", Value}]. --- End diff -- And as for IE 8 and 9 (which are also remains popular) there is need to use [X-XSS-Protection](http://blogs.msdn.com/b/ieinternals/archive/2011/01/31/controlling-the-internet-explorer-xss-filter-with-the-x-xss-protection-http-header.aspx) header instead. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---