summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd.erl
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-01-19 22:22:37 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-01-19 22:22:37 +0000
commit8d735cb60ee4ca15dd9f60f916d001c4b9efb675 (patch)
treef23baacf3b9e9f7cc3128bb2c6b6e2d8114d7790 /src/couchdb/couch_httpd.erl
parent55e61d341f4c73b7c50ca6bca151d86d1f5f43f5 (diff)
fix for COUCHDB-214 (design docs on dbs with slashes)
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@735850 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd.erl')
-rw-r--r--src/couchdb/couch_httpd.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index e6b1c895..a9c7320a 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -16,7 +16,7 @@
-export([start_link/0, stop/0, handle_request/3]).
-export([header_value/2,header_value/3,qs_value/2,qs_value/3,qs/1,path/1]).
--export([verify_is_server_admin/1,unquote/1,recv/2]).
+-export([verify_is_server_admin/1,unquote/1,quote/1,recv/2]).
-export([parse_form/1,json_body/1,body/1,doc_etag/1]).
-export([primary_header_value/2,partition/1,serve_file/3]).
-export([start_chunked_response/3,send_chunk/2]).
@@ -152,7 +152,9 @@ handle_request(MochiReq, UrlHandlers, DbUrlHandlers) ->
try
HandlerFun(HttpReq#httpd{user_ctx=AuthenticationFun(HttpReq)})
catch
- _Tag:Error ->
+ Tag:Error ->
+ ?LOG_ERROR("Uncaught error in HTTP request: ~p",[{Tag, Error}]),
+ ?LOG_DEBUG("Stacktrace: ~p",[erlang:get_stacktrace()]),
send_error(HttpReq, Error)
end,
@@ -241,6 +243,9 @@ path(#httpd{mochi_req=MochiReq}) ->
unquote(UrlEncodedString) ->
mochiweb_util:unquote(UrlEncodedString).
+quote(UrlDecodedString) ->
+ mochiweb_util:quote_plus(UrlDecodedString).
+
parse_form(#httpd{mochi_req=MochiReq}) ->
mochiweb_multipart:parse_form(MochiReq).