Here is a similar patch that I've been using.  The primary
difference is that mine ignores parameters such as charset=UTF-8.
Also, it treats plain application/xml as binary; perhaps I should
change that.
Index: validate.c
===================================================================
--- validate.c	(revision 9614)
+++ validate.c	(working copy)
@@ -65,8 +65,27 @@
 svn_boolean_t
 svn_mime_type_is_binary (const char *mime_type)
 {
-  return ((strncmp (mime_type, "text/", 5) != 0)
-          && (strcmp (mime_type, "image/x-xbitmap") != 0)
-          && (strcmp (mime_type, "image/x-xpixmap") != 0)
-          );
+  /* To get "Content-Type: text/html; charset=UTF-8" from mod_dav_svn,
+     the charset must be in the svn:mime-type property too.  Ignore
+     any such parameters here.
+
+     RFC 2045 (5.1) and RFC 2616 (3.7) say that the type/subtype pair
+     must be compared case-insensitively.  RFC 2616 (2.2 and 14.17)
+     prohibits comments in HTTP Content-Type even though RFC 2045
+     (5.1) allows them in email.  */
+
+  size_t len = strcspn (mime_type, " ;");
+  
+  if (strncasecmp (mime_type, "text/", 5) == 0)
+    return FALSE;
+
+  if (len == 15 && strncasecmp (mime_type, "image/x-xbitmap", len) == 0)
+    return FALSE;
+  if (len == 15 && strncasecmp (mime_type, "image/x-xpixmap", len) == 0)
+    return FALSE;
+
+  if (len >= 4 && strncasecmp (mime_type + len - 4, "+xml", 4) == 0)
+    return FALSE;
+
+  return TRUE;
 }
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun May 16 10:24:46 2004