couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [07/11] chttpd commit: updated refs/heads/master to 238b8c4
Date Wed, 12 Aug 2015 15:54:31 GMT
Use #httpd.absolute_uri


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/9118f8da
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/9118f8da
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/9118f8da

Branch: refs/heads/master
Commit: 9118f8da1134e6cf5a701e8bbeef270e6c29507b
Parents: 8d8cf91
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Mon Jun 22 11:37:54 2015 -0700
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Aug 11 09:14:29 2015 -0700

----------------------------------------------------------------------
 src/chttpd.erl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/9118f8da/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index 7a7bad9..6a80f05 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -481,7 +481,7 @@ qs(#httpd{mochi_req=MochiReq}) ->
 path(#httpd{mochi_req=MochiReq}) ->
     MochiReq:get(path).
 
-absolute_uri(#httpd{mochi_req=MochiReq}, Path) ->
+absolute_uri(#httpd{mochi_req=MochiReq, absolute_uri = undefined}, Path) ->
     XHost = config:get("httpd", "x_forwarded_host", "X-Forwarded-Host"),
     Host = case MochiReq:get_header_value(XHost) of
         undefined ->
@@ -512,7 +512,9 @@ absolute_uri(#httpd{mochi_req=MochiReq}, Path) ->
                     end
             end
     end,
-    Scheme ++ "://" ++ Host ++ Path.
+    Scheme ++ "://" ++ Host ++ Path;
+absolute_uri(#httpd{absolute_uri = URI}, Path) ->
+    URI ++ Path.
 
 unquote(UrlEncodedString) ->
     mochiweb_util:unquote(UrlEncodedString).


Mime
View raw message