couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r732407 - in /couchdb/trunk: THANKS src/couchdb/couch_httpd_view.erl
Date Wed, 07 Jan 2009 17:33:32 GMT
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 <adam.kocoloski@gmail.com>
  * Roger Leigh <rleigh@debian.org>
  * Jim Lindley <web@jimlindley.com>
+ * Hunter Morris <huntermorris@gmail.com>
  * Sam Ruby <rubys@intertwingly.net>
  * Dirk Schalge <dirk@epd-me.net>
  * Carlos Valiente <superdupont@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;



Mime
View raw message