couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r709578 - in /incubator/couchdb/trunk: etc/couchdb/default.ini.tpl.in src/couchdb/couch_httpd_misc_handlers.erl
Date Fri, 31 Oct 2008 21:46:35 GMT
Author: jchris
Date: Fri Oct 31 14:46:34 2008
New Revision: 709578

URL: http://svn.apache.org/viewvc?rev=709578&view=rev
Log:
couchdb once again serves favicon.ico

Modified:
    incubator/couchdb/trunk/etc/couchdb/default.ini.tpl.in
    incubator/couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl

Modified: incubator/couchdb/trunk/etc/couchdb/default.ini.tpl.in
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/etc/couchdb/default.ini.tpl.in?rev=709578&r1=709577&r2=709578&view=diff
==============================================================================
--- incubator/couchdb/trunk/etc/couchdb/default.ini.tpl.in (original)
+++ incubator/couchdb/trunk/etc/couchdb/default.ini.tpl.in Fri Oct 31 14:46:34 2008
@@ -29,6 +29,8 @@
 
 [httpd_global_handlers]
 / = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>}
+favicon.ico = {couch_httpd_misc_handlers, handle_favicon_req, "%localdatadir%/www"}
+
 _utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "%localdatadir%/www"}
 _all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req}
 _config = {couch_httpd_misc_handlers, handle_config_req}

Modified: incubator/couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl?rev=709578&r1=709577&r2=709578&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl (original)
+++ incubator/couchdb/trunk/src/couchdb/couch_httpd_misc_handlers.erl Fri Oct 31 14:46:34
2008
@@ -12,7 +12,7 @@
 
 -module(couch_httpd_misc_handlers).
 
--export([handle_welcome_req/2,handle_utils_dir_req/2,handle_all_dbs_req/1,
+-export([handle_welcome_req/2,handle_favicon_req/2,handle_utils_dir_req/2,handle_all_dbs_req/1,
     handle_replicate_req/1,handle_restart_req/1,handle_uuids_req/1,
     handle_config_req/1]).
     
@@ -36,7 +36,11 @@
 handle_welcome_req(Req, _) ->
     send_method_not_allowed(Req, "GET,HEAD").
 
-
+handle_favicon_req(#httpd{method='GET'}=Req, DocumentRoot) ->
+    couch_httpd:serve_file(Req, "favicon.ico", DocumentRoot);
+handle_favicon_req(Req, _) ->
+    send_method_not_allowed(Req, "GET,HEAD").
+    
 handle_utils_dir_req(#httpd{method='GET'}=Req, DocumentRoot) ->
     "/" ++ UrlPath = couch_httpd:path(Req),
     case couch_httpd:partition(UrlPath) of



Mime
View raw message