Details
Description
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