couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iil...@apache.org
Subject [01/50] couch-httpd commit: updated refs/heads/split_out_httpd_stack to e44a372
Date Tue, 01 Mar 2016 20:00:34 GMT
Repository: couchdb-couch-httpd
Updated Branches:
  refs/heads/split_out_httpd_stack [created] e44a372ee


Remove exact copy of absolute_uri/2 from original


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/commit/cc27368e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/tree/cc27368e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/diff/cc27368e

Branch: refs/heads/split_out_httpd_stack
Commit: cc27368ea71108a8f9f9dd219aef07a0e7b5fda6
Parents: 9b3b8b5
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Thu Feb 25 10:57:00 2016 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Mar 1 08:35:06 2016 -0800

----------------------------------------------------------------------
 src/couch_httpd_original.erl | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/cc27368e/src/couch_httpd_original.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_original.erl b/src/couch_httpd_original.erl
index 08d7710..504d100 100644
--- a/src/couch_httpd_original.erl
+++ b/src/couch_httpd_original.erl
@@ -16,7 +16,6 @@
 -export([start_link/0, start_link/1, stop/0, handle_request/5]).
 
 
--export([absolute_uri/2]).
 -export([verify_is_server_admin/1,error_info/1]).
 -export([make_fun_spec_strs/1]).
 
@@ -65,7 +64,8 @@
     serve_file/4,
     send/2,
     send_method_not_allowed/2,
-    send_redirect/2
+    send_redirect/2,
+    absolute_uri/2
 ]).
 
 -define(HANDLER_NAME_IN_MODULE_POS, 6).
@@ -474,25 +474,6 @@ host_for_request(#httpd{mochi_req=MochiReq}) ->
         Value -> Value
     end.
 
-absolute_uri(#httpd{mochi_req=MochiReq}=Req, Path) ->
-    Host = host_for_request(Req),
-    XSsl = config:get("httpd", "x_forwarded_ssl", "X-Forwarded-Ssl"),
-    Scheme = case MochiReq:get_header_value(XSsl) of
-                 "on" -> "https";
-                 _ ->
-                     XProto = 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";
-                         _ -> case MochiReq:get(scheme) of
-                                  https -> "https";
-                                  http -> "http"
-                              end
-                     end
-             end,
-    Scheme ++ "://" ++ Host ++ Path.
-
-
 body(#httpd{mochi_req=MochiReq, req_body=undefined}) ->
     MaxSize = list_to_integer(
         config:get("couchdb", "max_document_size", "4294967296")),


Mime
View raw message