You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Bernd Rosstauscher (JIRA)" <ji...@apache.org> on 2010/02/23 12:02:28 UTC

[jira] Created: (WICKET-2757) MimeType/ContentType detection in ResourceStreamRequestTarget unreliable

MimeType/ContentType detection in ResourceStreamRequestTarget unreliable
------------------------------------------------------------------------

                 Key: WICKET-2757
                 URL: https://issues.apache.org/jira/browse/WICKET-2757
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.6
         Environment: Wicket 1.4.0 in embedded Jetty
            Reporter: Bernd Rosstauscher
            Priority: Minor


With WICKET-356 the content type detection moved from the resoure stream to the ResourceStreamRequestTarget configure method.
There the content type is detected with the following schema:
1. If in stream a content type is set (deprecated) then use that one
2. If on the stream a file name is set use the filename for detection
3. Else use the request URL for detection.

The last option is not reliable. In Line 230 we have the following code

response.detectContentType(requestCycle, requestCycle.getRequest().getURL());

I think it should be 

response.detectContentType(requestCycle, requestCycle.getRequest().getPath());

In my case the request I have parameters attached to the Request URL like this.

web/test.tif?sso=dsagdfgdsfhfg438efgkd549456

And this is passed to the detectContentType() method and this fails because it expects a file name with a file extension.
Using option 1. to fix this is working but is deprecated using option 2. and setting a file name does not work because it has the side effect to set the content disposition header

I'm no wicket expert so I don't now if my suggested change will have side effects. But please consider fixing this.

Thanks,
- Bernd Rosstauscher

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2757) MimeType/ContentType detection in ResourceStreamRequestTarget unreliable

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2757.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-M1
                   1.4.7
         Assignee: Igor Vaynberg

> MimeType/ContentType detection in ResourceStreamRequestTarget unreliable
> ------------------------------------------------------------------------
>
>                 Key: WICKET-2757
>                 URL: https://issues.apache.org/jira/browse/WICKET-2757
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>         Environment: Wicket 1.4.0 in embedded Jetty
>            Reporter: Bernd Rosstauscher
>            Assignee: Igor Vaynberg
>            Priority: Minor
>             Fix For: 1.4.7, 1.5-M1
>
>
> With WICKET-356 the content type detection moved from the resoure stream to the ResourceStreamRequestTarget configure method.
> There the content type is detected with the following schema:
> 1. If in stream a content type is set (deprecated) then use that one
> 2. If on the stream a file name is set use the filename for detection
> 3. Else use the request URL for detection.
> The last option is not reliable. In Line 230 we have the following code
> response.detectContentType(requestCycle, requestCycle.getRequest().getURL());
> I think it should be 
> response.detectContentType(requestCycle, requestCycle.getRequest().getPath());
> In my case the request I have parameters attached to the Request URL like this.
> web/test.tif?sso=dsagdfgdsfhfg438efgkd549456
> And this is passed to the detectContentType() method and this fails because it expects a file name with a file extension.
> Using option 1. to fix this is working but is deprecated using option 2. and setting a file name does not work because it has the side effect to set the content disposition header
> I'm no wicket expert so I don't now if my suggested change will have side effects. But please consider fixing this.
> Thanks,
> - Bernd Rosstauscher

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.