You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2007/12/12 10:36:45 UTC
[jira] Commented: (SLING-135) DefaultSlingServlet.spool is fragile
w.r.t content-types
[ https://issues.apache.org/jira/browse/SLING-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12550892 ]
Carsten Ziegeler commented on SLING-135:
----------------------------------------
I don't think that the MimeTypeServiceImpl is affected as it is searching for the last dot - which should be safe.
> DefaultSlingServlet.spool is fragile w.r.t content-types
> --------------------------------------------------------
>
> Key: SLING-135
> URL: https://issues.apache.org/jira/browse/SLING-135
> Project: Sling
> Issue Type: Bug
> Components: microsling, MimeType
> Reporter: Bertrand Delacretaz
> Priority: Minor
>
> That method currently uses this code to set the content-type when spooling files:
> protected void spool(URL url, SlingHttpServletResponse res) throws IOException {
> URLConnection conn = url.openConnection();
> // this previously used conn.getContentType(), but see SLING-112
> res.setContentType(getServletContext().getMimeType(url.getFile()));
> Problem is, if microsling runs under a path that contains dots, like
> /usling.1.2/install,
> url.getFile() returns the full path including dots, like
> /usling.1.2/install/foo/index.html
> and that failed on me when running with a somewhat exotic servlet engine, which probably broke the string after the first dot, didn't find a content-type and didn't accept getting null as a content-type.
> This should be made more robust.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.