[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wink-dev
Subject:    [jira] [Commented] (WINK-374) MessageBodyWriter writeTo getting wrong MediaType
From:       Reto_Bachmann-Gmür_(JIRA) <jira () apache ! org>
Date:       2012-12-05 14:17:00
Message-ID: 1831852693.63363.1354717020195.JavaMail.jiratomcat () arcas
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/WINK-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510494#comment-13510494 \
] 

Reto Bachmann-Gmür commented on WINK-374:
-----------------------------------------

I just looked at the source to see if I could at least provide a test that shows the \
problem. But I didn't find some examples I could have adapted. I saw however that a \
FileProvider - MessageBodyWriter exists, this could benefit from this issue being \
fixed and guess the media type from the extension if the resource method doesn't \
specify one (such as by using URLConnection.guessContentTypeFromName).  
> MessageBodyWriter writeTo getting wrong MediaType
> -------------------------------------------------
> 
> Key: WINK-374
> URL: https://issues.apache.org/jira/browse/WINK-374
> Project: Wink
> Issue Type: Bug
> Reporter: Reto Bachmann-Gmür
> 
> When the resource method does not specify a MediaType with @Produces the \
> MessageBodyWriters writeTo method gets invoked with the first media type in the \
> Accept header as mediaType parameter. This is wron, according to section 3.8 of the \
> spec it should be applicat8ion/octet-stream. It is important that the the \
> MessageBody Writer knows if the type was restricted by the resource method (in \
> which case it should get the respective media-type) or not, in which case it might \
> set the http header itself based on the instance to be written.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic