couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r820495 - /couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl
Date Wed, 30 Sep 2009 23:31:48 GMT
Author: jchris
Date: Wed Sep 30 23:31:48 2009
New Revision: 820495

URL: http://svn.apache.org/viewvc?rev=820495&view=rev
Log:
_uuid ETags were coming out as random binary noise. fixes this so they are proper strings.
Needs backporting to 0.10.x.

Modified:
    couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl?rev=820495&r1=820494&r2=820495&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl Wed Sep 30 23:31:48 2009
@@ -107,14 +107,15 @@
 handle_uuids_req(#httpd{method='GET'}=Req) ->
     Count = list_to_integer(couch_httpd:qs_value(Req, "count", "1")),
     UUIDs = [couch_uuids:new() || _ <- lists:seq(1, Count)],
-    couch_httpd:etag_respond(Req, erlang:md5(UUIDs), fun() ->
+    Etag = couch_httpd:make_etag(UUIDs),
+    couch_httpd:etag_respond(Req, Etag, fun() ->
         CacheBustingHeaders = [
             {"Date", httpd_util:rfc1123_date()},
             {"Cache-Control", "no-cache"},
             % Past date, ON PURPOSE!
             {"Expires", "Fri, 01 Jan 1990 00:00:00 GMT"},
             {"Pragma", "no-cache"},
-            {"ETag", erlang:md5(UUIDs)}
+            {"ETag", Etag}
         ],
         send_json(Req, 200, CacheBustingHeaders, {[{<<"uuids">>, UUIDs}]})
     end);



Mime
View raw message