You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by jc...@apache.org on 2009/01/07 18:33:32 UTC

svn commit: r732407 - in /couchdb/trunk: THANKS src/couchdb/couch_httpd_view.erl

Author: jchris
Date: Wed Jan  7 09:33:31 2009
New Revision: 732407

URL: http://svn.apache.org/viewvc?rev=732407&view=rev
Log:
apply patch to fix include docs q param parsing

Modified:
    couchdb/trunk/THANKS
    couchdb/trunk/src/couchdb/couch_httpd_view.erl

Modified: couchdb/trunk/THANKS
URL: http://svn.apache.org/viewvc/couchdb/trunk/THANKS?rev=732407&r1=732406&r2=732407&view=diff
==============================================================================
--- couchdb/trunk/THANKS (original)
+++ couchdb/trunk/THANKS Wed Jan  7 09:33:31 2009
@@ -19,6 +19,7 @@
  * Adam Kocoloski <ad...@gmail.com>
  * Roger Leigh <rl...@debian.org>
  * Jim Lindley <we...@jimlindley.com>
+ * Hunter Morris <hu...@gmail.com>
  * Sam Ruby <ru...@intertwingly.net>
  * Dirk Schalge <di...@epd-me.net>
  * Carlos Valiente <su...@gmail.com>

Modified: couchdb/trunk/src/couchdb/couch_httpd_view.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_view.erl?rev=732407&r1=732406&r2=732407&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_view.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_view.erl Wed Jan  7 09:33:31 2009
@@ -306,19 +306,6 @@
         {"reduce", "false"} ->
             Args#view_query_args{reduce=false};
         {"include_docs", Value} ->
-            case IsReduce of
-            true ->
-                #view_query_args{reduce=OptReduce} = Args,
-                case OptReduce of
-                    true ->
-                        Msg = lists:flatten(io_lib:format("Bad URL query key for reduce operation: ~s", [Key])),
-                        throw({query_parse_error, Msg});
-                _ ->
-                    ok
-                end;
-            _ ->
-                ok
-            end,
             case Value of
             "true" ->
                 Args#view_query_args{include_docs=true};
@@ -334,6 +321,18 @@
             throw({query_parse_error, Msg})
         end
     end, #view_query_args{}, QueryList),
+    case IsReduce of
+    true ->
+        case QueryArgs#view_query_args.include_docs and QueryArgs#view_query_args.reduce of
+        true ->
+            ErrMsg = "Bad URL query key for reduce operation: include_docs",
+            throw({query_parse_error, ErrMsg});
+        _ ->
+            ok
+        end;
+    _ ->
+        ok
+    end,
     case Keys of
     nil ->
         QueryArgs;