couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1095202 - in /couchdb/branches/1.0.x: src/couchdb/couch_httpd_db.erl test/etap/140-attachment-comp.t
Date Tue, 19 Apr 2011 20:38:22 GMT
Author: fdmanana
Date: Tue Apr 19 20:38:22 2011
New Revision: 1095202

URL: http://svn.apache.org/viewvc?rev=1095202&view=rev
Log:
Merged revision 1095200 from trunk

    Don't set Content-Encoding headers with value "identity"

    This is dictated by RFC 2616 and causes problems with Microsoft's ISA 2006 proxy.
    Closes COUCHDB-1128.
    Thanks Paul Davis and Andrew Gleave.


Modified:
    couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl
    couchdb/branches/1.0.x/test/etap/140-attachment-comp.t

Modified: couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl?rev=1095202&r1=1095201&r2=1095202&view=diff
==============================================================================
--- couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/branches/1.0.x/src/couchdb/couch_httpd_db.erl Tue Apr 19 20:38:22 2011
@@ -913,7 +913,9 @@ db_attachment_req(#httpd{method='GET'}=R
             {"Cache-Control", "must-revalidate"},
             {"Content-Type", binary_to_list(Type)}
         ] ++ case ReqAcceptsAttEnc of
-        true ->
+        true when Enc =/= identity ->
+            % RFC 2616 says that the 'identify' encoding should not be used in
+            % the Content-Encoding header
             [{"Content-Encoding", atom_to_list(Enc)}];
         _ ->
             []

Modified: couchdb/branches/1.0.x/test/etap/140-attachment-comp.t
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/test/etap/140-attachment-comp.t?rev=1095202&r1=1095201&r2=1095202&view=diff
==============================================================================
--- couchdb/branches/1.0.x/test/etap/140-attachment-comp.t (original)
+++ couchdb/branches/1.0.x/test/etap/140-attachment-comp.t Tue Apr 19 20:38:22 2011
@@ -19,7 +19,7 @@ test_db_name() ->
 main(_) ->
     test_util:init_code_path(),
 
-    etap:plan(86),
+    etap:plan(85),
     case (catch test()) of
         ok ->
             etap:end_tests();
@@ -254,8 +254,8 @@ test_get_1st_png_att_without_accept_enco
         [],
         [{sync, true}]),
     etap:is(Code, 200, "HTTP response code is 200"),
-    Gziped = lists:member({"content-encoding", "gzip"}, Headers),
-    etap:is(Gziped, false, "received body is not gziped"),
+    Encoding = couch_util:get_value("content-encoding", Headers),
+    etap:is(Encoding, undefined, "received body is not gziped"),
     etap:is(
         Body,
         test_png_data(),
@@ -270,8 +270,8 @@ test_get_1st_png_att_with_accept_encodin
         [],
         [{sync, true}]),
     etap:is(Code, 200, "HTTP response code is 200"),
-    Gziped = lists:member({"content-encoding", "gzip"}, Headers),
-    etap:is(Gziped, false, "received body is not gziped"),
+    Encoding = couch_util:get_value("content-encoding", Headers),
+    etap:is(Encoding, undefined, "received body is not gziped"),
     etap:is(
         Body,
         test_png_data(),
@@ -286,10 +286,8 @@ test_get_1st_png_att_with_accept_encodin
         [],
         [{sync, true}]),
     etap:is(Code, 200, "HTTP response code is 200"),
-    Deflated = lists:member({"content-encoding", "deflate"}, Headers),
-    etap:is(Deflated, false, "received body is not deflated"),
-    Gziped = lists:member({"content-encoding", "gzip"}, Headers),
-    etap:is(Gziped, false, "received body is not gziped"),
+    Encoding = couch_util:get_value("content-encoding", Headers),
+    etap:is(Encoding, undefined, "received body is in identity form"),
     etap:is(
         Body,
         test_png_data(),



Mime
View raw message