You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2009/06/15 11:49:47 UTC

svn commit: r784706 - in /couchdb/trunk: share/www/script/test/show_documents.js src/couchdb/couch_httpd.erl src/couchdb/couch_httpd_external.erl

Author: jan
Date: Mon Jun 15 09:49:46 2009
New Revision: 784706

URL: http://svn.apache.org/viewvc?rev=784706&view=rev
Log:
Send CouchDB Server: header for all external queries. Fixes COUCHDB-379.

Modified:
    couchdb/trunk/share/www/script/test/show_documents.js
    couchdb/trunk/src/couchdb/couch_httpd.erl
    couchdb/trunk/src/couchdb/couch_httpd_external.erl

Modified: couchdb/trunk/share/www/script/test/show_documents.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/show_documents.js?rev=784706&r1=784705&r2=784706&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/show_documents.js (original)
+++ couchdb/trunk/share/www/script/test/show_documents.js Mon Jun 15 09:49:46 2009
@@ -148,6 +148,9 @@
 // 
 // function foo() {
 
+  // Fix for COUCHDB-379
+  T(equals(xhr.getResponseHeader("Server").substr(0,7), "CouchDB"));
+
   // // error stacktraces
   // xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/render-error/"+docid);
   // T(JSON.parse(xhr.responseText).error == "render_error");

Modified: couchdb/trunk/src/couchdb/couch_httpd.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?rev=784706&r1=784705&r2=784706&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd.erl Mon Jun 15 09:49:46 2009
@@ -18,7 +18,7 @@
 -export([header_value/2,header_value/3,qs_value/2,qs_value/3,qs/1,path/1,absolute_uri/2]).
 -export([verify_is_server_admin/1,unquote/1,quote/1,recv/2,recv_chunked/4,error_info/1]).
 -export([parse_form/1,json_body/1,json_body_obj/1,body/1,doc_etag/1, make_etag/1, etag_respond/3]).
--export([primary_header_value/2,partition/1,serve_file/3]).
+-export([primary_header_value/2,partition/1,serve_file/3, server_header/0]).
 -export([start_chunked_response/3,send_chunk/2]).
 -export([start_json_response/2, start_json_response/3, end_json_response/1]).
 -export([send_response/4,send_method_not_allowed/2,send_error/4, send_redirect/2,send_chunked_error/2]).

Modified: couchdb/trunk/src/couchdb/couch_httpd_external.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_external.erl?rev=784706&r1=784705&r2=784706&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_external.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_external.erl Mon Jun 15 09:49:46 2009
@@ -100,7 +100,7 @@
         headers = Headers
     } = parse_external_response(Response),
     Resp = MochiReq:respond({Code, 
-        default_or_content_type(CType, Headers), Data}),
+        default_or_content_type(CType, Headers ++ couch_httpd:server_header()), Data}),
     {ok, Resp}.
 
 parse_external_response({Response}) ->