 ===================================================================
 --- sope-appserver/NGObjWeb/ChangeLog	(revision 1660)
 +++ sope-appserver/NGObjWeb/ChangeLog	(working copy)
-@@ -1,3 +1,11 @@
+@@ -1,3 +1,22 @@
++2009-07-02  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
++
++	* WOMessage.m (-setHeaders:, -setHeader:forKey:, headerForKey:,
++	-appendHeader:forKey:, -appendHeaders:forKey:, setHeaders:forKey:,
++	-headersForKey:): convert the specified header key to lowercase,
++	to ensure they are managed case-insensitively.
++	* WOHttpAdaptor/WOHttpTransaction.m
++	(-deliverResponse:toRequest:onStream:): if the content-type is
++	specified and already has "text/plain" as prefix, we don't
++	override it.
++
 +2009-07-01  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 +
 +	* WOHttpAdaptor/WOHttpTransaction.m

   BOOL          sidInUrl;
 
   /* 'ivar' associations */
Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m
===================================================================
--- sope-appserver/NGObjWeb/SoObjects/SoObject.m	(revision 1660)

     
     doZip = [_response shouldZipResponseToRequest:_request];
     
@@ -738,7 +739,11 @@
     
     /* add content length header */
     
-    snprintf((char *)buf, sizeof(buf), "%d", [body length]);
+    if ((length = [body length]) == 0
+        && ![[_response headerForKey: @"content-type"] hasPrefix:@"text/plain"]) {
+      [_response setHeader:@"text/plain" forKey:@"content-type"];
+    }
+    snprintf((char *)buf, sizeof(buf), "%d", length);
     t1 = [[NSString alloc] initWithCString:(char *)buf];
     [_response setHeader:t1 forKey:@"content-length"];
     [t1 release]; t1 = nil;
@@ -766,7 +771,7 @@
         NSString *value;
 	
 	if (!hasConnectionHeader) {
-	  if ([fieldName caseInsensitiveCompare:@"connection"]==NSOrderedSame)
+	  if ([fieldName isEqualToString:@"connection"])
 	    hasConnectionHeader = YES;
 	}
 	
