Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 3 contributors
Showing with 8 additions and 7 deletions.
  1. +3 −3 src/chttpd.erl
  2. +4 −3 src/chttpd_db.erl
  3. +1 −1 src/chttpd_external.erl
View
6 src/chttpd.erl
@@ -591,10 +591,10 @@ send_error(Req, Error) ->
send_error(Req, Code1, Headers, ErrorStr, ReasonStr, json_stack(Error)).
send_error(Req, Code, ErrorStr, ReasonStr) ->
- send_error(Req, Code, ErrorStr, ReasonStr, []).
+ send_error(Req, Code, [], ErrorStr, ReasonStr, []).
-send_error(Req, Code, ErrorStr, ReasonStr, Stack) ->
- send_error(Req, Code, [], ErrorStr, ReasonStr, Stack).
+send_error(Req, Code, Headers, ErrorStr, ReasonStr) ->
+ send_error(Req, Code, Headers, ErrorStr, ReasonStr, []).
send_error(Req, Code, Headers, ErrorStr, ReasonStr, Stack) ->
send_json(Req, Code, Headers,
View
7 src/chttpd_db.erl
@@ -240,13 +240,14 @@ db_req(#httpd{method='POST',path_parts=[_,<<"_bulk_docs">>], user_ctx=Ctx}=Req,
couch_httpd:validate_ctype(Req, "application/json"),
{JsonProps} = chttpd:json_body_obj(Req),
DocsArray = couch_util:get_value(<<"docs">>, JsonProps),
+ W = couch_httpd:qs_value(Req, "w", couch_config:get("cluster", "w", "2")),
case chttpd:header_value(Req, "X-Couch-Full-Commit") of
"true" ->
- Options = [full_commit, {user_ctx,Ctx}];
+ Options = [full_commit, {user_ctx,Ctx}, {w,W}];
"false" ->
- Options = [delay_commit, {user_ctx,Ctx}];
+ Options = [delay_commit, {user_ctx,Ctx}, {w,W}];
_ ->
- Options = [{user_ctx,Ctx}]
+ Options = [{user_ctx,Ctx}, {w,W}]
end,
case couch_util:get_value(<<"new_edits">>, JsonProps, true) of
true ->
View
2 src/chttpd_external.erl
@@ -69,7 +69,7 @@ json_req_obj(#httpd{mochi_req=Req,
Else -> Else
end,
ParsedForm = case Req:get_primary_header_value("content-type") of
- "application/x-www-form-urlencoded" ++ _ ->
+ "application/x-www-form-urlencoded" ++ _ when Method =:= 'POST' ->
mochiweb_util:parse_qs(Body);
_ ->
[]

No commit comments for this range

Something went wrong with that request. Please try again.