[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r14262 - trunk/subversion/mod_dav_svn

From: <kfogel_at_collab.net>
Date: 2005-05-04 22:52:36 CEST

sussman@tigris.org writes:
> --- trunk/subversion/mod_dav_svn/liveprops.c (original)
> +++ trunk/subversion/mod_dav_svn/liveprops.c Sat Apr 16 21:38:01 2005
> @@ -344,29 +345,32 @@
> return DAV_PROP_INSERT_NOTSUPP;
> }
>
> - serr = svn_fs_node_prop (&pval, resource->info->root.root,
> - resource->info->repos_path,
> - SVN_PROP_MIME_TYPE, p);
> -
> - if ((serr != NULL) || (pval == NULL))
> + if (resource->collection) /* defaults for directories */
> {
> - svn_error_clear(serr);
> - if (resource->collection) /* defaults for directories */
> - {
> - if (resource->info->repos->xslt_uri)
> - value = "text/xml";
> - else
> - value = "text/html";
> - }
> + if (resource->info->repos->xslt_uri)
> + mime_type = "text/xml";
> else
> - {
> - value = "text/plain"; /* default for file */
> - }
> - }
> + mime_type = "text/html; charset=UTF-8";
> + }
> else
> {
> - serr = svn_mime_type_validate (pval->data, p);
> - if (serr)
> + if ((serr = svn_fs_node_prop (&pval, resource->info->root.root,
> + resource->info->repos_path,
> + SVN_PROP_MIME_TYPE, p)))
> + {
> + svn_error_clear(serr);
> + pval = NULL;
> + }
> +
> + if (pval)
> + mime_type = pval->data;
> + else if ((! resource->info->repos->is_svn_client)
> + && resource->info->r->content_type)
> + mime_type = resource->info->r->content_type;
> + else
> + mime_type = "text/plain"; /* default for file */

I just asked Ben why we default to "text/plain" instead of
"application/octet-stream" here. He didn't know either.

(The code was that way before, it just got reshifted in this commit.)

I would think "application/octet-stream" would be a lot safer when we
don't know anything about the file. Does anyone know more about this?

> --- trunk/subversion/mod_dav_svn/repos.c (original)
> +++ trunk/subversion/mod_dav_svn/repos.c Sat Apr 16 21:38:01 2005
> @@ -2087,7 +2109,13 @@
> "could not fetch the resource's MIME type",
> resource->pool);
>
> - mimetype = value ? value->data : "text/plain";
> + if (value)
> + mimetype = value->data;
> + else if ((! resource->info->repos->is_svn_client)
> + && r->content_type)
> + mimetype = r->content_type;
> + else
> + mimetype = "text/plain";

Same question here.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 4 23:25:49 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.