Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 81561 invoked from network); 2 Oct 2009 16:00:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Oct 2009 16:00:53 -0000 Received: (qmail 5067 invoked by uid 500); 2 Oct 2009 16:00:53 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 4990 invoked by uid 500); 2 Oct 2009 16:00:52 -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 4981 invoked by uid 99); 2 Oct 2009 16:00:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 16:00:52 +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; Fri, 02 Oct 2009 16:00:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 231DF23889C7; Fri, 2 Oct 2009 16:00:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r821071 - /couchdb/branches/0.10.x/src/couchdb/couch_httpd.erl Date: Fri, 02 Oct 2009 16:00:29 -0000 To: commits@couchdb.apache.org From: jasondavies@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091002160029.231DF23889C7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jasondavies Date: Fri Oct 2 16:00:28 2009 New Revision: 821071 URL: http://svn.apache.org/viewvc?rev=821071&view=rev Log: Merged fix from trunk: OAuth support for "https" URL scheme when using SSL proxy. Modified: couchdb/branches/0.10.x/src/couchdb/couch_httpd.erl Modified: couchdb/branches/0.10.x/src/couchdb/couch_httpd.erl URL: http://svn.apache.org/viewvc/couchdb/branches/0.10.x/src/couchdb/couch_httpd.erl?rev=821071&r1=821070&r2=821071&view=diff ============================================================================== --- couchdb/branches/0.10.x/src/couchdb/couch_httpd.erl (original) +++ couchdb/branches/0.10.x/src/couchdb/couch_httpd.erl Fri Oct 2 16:00:28 2009 @@ -278,7 +278,18 @@ end; Value -> Value end, - "http://" ++ Host ++ Path. + XSsl = couch_config:get("httpd", "x_forwarded_ssl", "X-Forwarded-Ssl"), + Scheme = case MochiReq:get_header_value(XSsl) of + "on" -> "https"; + _ -> + XProto = couch_config:get("httpd", "x_forwarded_proto", "X-Forwarded-Proto"), + case MochiReq:get_header_value(XProto) of + % Restrict to "https" and "http" schemes only + "https" -> "https"; + _ -> "http" + end + end, + Scheme ++ "://" ++ Host ++ Path. unquote(UrlEncodedString) -> mochiweb_util:unquote(UrlEncodedString).