Skip to content

Instantly share code, notes, and snippets.

@davidcoallier
Created May 12, 2010 13:23
Show Gist options
  • Save davidcoallier/398585 to your computer and use it in GitHub Desktop.
Save davidcoallier/398585 to your computer and use it in GitHub Desktop.
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index d7f479b..2ac3ae5 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -37,6 +37,8 @@
handle_request(#httpd{path_parts=[DbName|RestParts],method=Method,
db_url_handlers=DbUrlHandlers}=Req)->
case {Method, RestParts} of
+ {'BREW', []} ->
+ send_brewing(Req);
{'PUT', []} ->
create_db_req(Req, DbName);
{'DELETE', []} ->
@@ -158,6 +160,9 @@ handle_design_info_req(#httpd{
handle_design_info_req(Req, _Db, _DDoc) ->
send_method_not_allowed(Req, "GET").
+send_brewing(#httpd{user_ctx=UserCtx}=Req) ->
+ send_error(Req, 419, [], <<"I am a Couch.">>, <<"I am what I am.">>).
+
create_db_req(#httpd{user_ctx=UserCtx}=Req, DbName) ->
ok = couch_httpd:verify_is_server_admin(Req),
LDbName = ?b2l(DbName),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment