Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 91827 invoked from network); 25 Jul 2010 17:02:31 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Jul 2010 17:02:31 -0000 Received: (qmail 5514 invoked by uid 500); 25 Jul 2010 17:02:31 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 5384 invoked by uid 500); 25 Jul 2010 17:02:30 -0000 Mailing-List: contact commits-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 commits@couchdb.apache.org Received: (qmail 5365 invoked by uid 99); 25 Jul 2010 17:02:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jul 2010 17:02:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jul 2010 17:02:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8F02D2388A3B; Sun, 25 Jul 2010 17:01:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r979070 - in /couchdb/trunk: etc/couchdb/local.ini src/couchdb/couch_httpd.erl Date: Sun, 25 Jul 2010 17:01:37 -0000 To: commits@couchdb.apache.org From: jchris@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100725170137.8F02D2388A3B@eris.apache.org> Author: jchris Date: Sun Jul 25 17:01:37 2010 New Revision: 979070 URL: http://svn.apache.org/viewvc?rev=979070&view=rev Log: send a basic-auth popup header if require_valid_user=true, to prevent lock-out Modified: couchdb/trunk/etc/couchdb/local.ini couchdb/trunk/src/couchdb/couch_httpd.erl Modified: couchdb/trunk/etc/couchdb/local.ini URL: http://svn.apache.org/viewvc/couchdb/trunk/etc/couchdb/local.ini?rev=979070&r1=979069&r2=979070&view=diff ============================================================================== --- couchdb/trunk/etc/couchdb/local.ini (original) +++ couchdb/trunk/etc/couchdb/local.ini Sun Jul 25 17:01:37 2010 @@ -14,7 +14,9 @@ ;WWW-Authenticate = Basic realm="administrator" [couch_httpd_auth] -; if you set this to true, you should also uncomment the WWW-Authenticate line above +; If you set this to true, you should also uncomment the WWW-Authenticate line +; above. If you don't configure a WWW-Authenticate header, CouchDB will send +; Basic realm="server" in order to prevent you getting logged out. ; require_valid_user = false [log] Modified: couchdb/trunk/src/couchdb/couch_httpd.erl URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=979070&r1=979069&r2=979070&view=diff ============================================================================== --- couchdb/trunk/src/couchdb/couch_httpd.erl (original) +++ couchdb/trunk/src/couchdb/couch_httpd.erl Sun Jul 25 17:01:37 2010 @@ -750,7 +750,8 @@ error_headers(#httpd{mochi_req=MochiReq} AuthRedirect -> case couch_config:get("couch_httpd_auth", "require_valid_user", "false") of "true" -> - {Code, []}; + % send the browser popup header no matter what if we are require_valid_user + {Code, [{"WWW-Authenticate", "Basic realm=\"server\""}]}; _False -> % if the accept header matches html, then do the redirect. else proceed as usual. case re:run(MochiReq:get_header_value("Accept"), "html", [{capture, none}]) of