[ 
https://issues.apache.org/jira/browse/MAPREDUCE-3613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262038#comment-13262038
 ] 

Robert Joseph Evans commented on MAPREDUCE-3613:
------------------------------------------------

I don't really like the fix because it requires all of the jersey methods to be 
modified, in exactly the same way, but that is the exact same fix as HDFS-2441 
did so I guess it is OK.

The root of the issue appears to be that HttpServer.QuotingInputFilter is 
trying to guess what the content type is based off of the URI of the request, 
and always setting it no matter what.  This seems to be so that we can set the 
charset of the response to be utf-8.  This is coupled with Jersey also 
outputting the content type instead of overwriting the one that was set 
previously.

Also it makes it more difficult for them to be called as regular methods.    I 
really would prefer to see something with the server where we could fix some of 
this in HttpServer itself so that we don't get the automatic content type for 
web services.  But that is likely to be a bigger change and would be a bit more 
cross project.  Sadly I tried upgrading to Jersey 1.12 and it does not fix the 
issue.

So reluctantly I give this a +1.

                
> web service calls header contains 2 content types
> -------------------------------------------------
>
>                 Key: MAPREDUCE-3613
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-3613
>             Project: Hadoop Map/Reduce
>          Issue Type: Sub-task
>          Components: mrv2
>    Affects Versions: 0.23.0
>            Reporter: Thomas Graves
>            Assignee: Thomas Graves
>            Priority: Critical
>         Attachments: MAPREDUCE-3613.patch
>
>
> when doing requesting info from the web services rest API, curl seems to 
> return content-type of both text and json or xml:
> > Accept: application/xml
> >
> < HTTP/1.1 200 OK
> < Content-Type: text/plain; charset=utf-8
> < Content-Type: application/xml

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to