From 6521c6ba57db9cd5c6ddb8fd1641b8c936008cb8 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Wed, 30 Sep 2009 23:31:48 +0000 Subject: _uuid ETags were coming out as random binary noise. fixes this so they are proper strings. Needs backporting to 0.10.x. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@820495 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd_misc_handlers.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl index 24eaa82e..7e2d9ea2 100644 --- a/src/couchdb/couch_httpd_misc_handlers.erl +++ b/src/couchdb/couch_httpd_misc_handlers.erl @@ -107,14 +107,15 @@ handle_restart_req(Req) -> 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); -- cgit v1.2.3