summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2009-02-11 16:12:39 +0000
committerDamien F. Katz <damien@apache.org>2009-02-11 16:12:39 +0000
commitfd31ca2f9ee86cafa2b55da5f969616a1e06926d (patch)
tree1f59347028521afed3e3301eaa2394981177de58 /src/couchdb
parent59f41c2678f59a2effade9651c0de11bbe811c56 (diff)
Changed _uuid to respond to GET instead of POST. Bug COUCHDB-190
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@743373 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_httpd_misc_handlers.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl
index 71a0e9ae..92ff3b0a 100644
--- a/src/couchdb/couch_httpd_misc_handlers.erl
+++ b/src/couchdb/couch_httpd_misc_handlers.erl
@@ -113,14 +113,18 @@ handle_restart_req(Req) ->
send_method_not_allowed(Req, "POST").
-handle_uuids_req(#httpd{method='POST'}=Req) ->
+handle_uuids_req(#httpd{method='GET'}=Req) ->
Count = list_to_integer(couch_httpd:qs_value(Req, "count", "1")),
+ CacheBustingHeaders = [{"Date", httpd_util:rfc1123_date()},
+ {"Cache-Control", "no-cache"},
+ {"Expires", "Fri, 01 Jan 1990 00:00:00 GMT"}, % Past date, ON PURPOSE!
+ {"Pragma", "no-cache"}],
% generate the uuids
UUIDs = [ couch_util:new_uuid() || _ <- lists:seq(1,Count)],
% send a JSON response
- send_json(Req, {[{<<"uuids">>, UUIDs}]});
+ send_json(Req, 200, CacheBustingHeaders, {[{<<"uuids">>, UUIDs}]});
handle_uuids_req(Req) ->
- send_method_not_allowed(Req, "POST").
+ send_method_not_allowed(Req, "GET").
% Config request handler