[GitHub] wink pull request: Fix Content-Type responses that include Accept ...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] wink pull request: Fix Content-Type responses that include Accept ...

ericdahl
GitHub user ericdahl opened a pull request:

    https://github.com/apache/wink/pull/1

    Fix Content-Type responses that include Accept header flags

    The Content-Type header may include the quality flags or other user-flags.
   
    Below is an example where the Accept quality flag is copied into the response.
    ```
    $ curl -v -H 'Accept: text/plain;q=0.5,application/json;q=0.1' 'http://localhost:8080/'
    ...
    < HTTP/1.1 200 OK
    < Date: Tue, 02 Sep 2014 00:22:14 GMT
    < Content-Type: text/plain;q=0.5
    < Transfer-Encoding: chunked
    * Server Jetty(9.2.2.v20140723) is not blacklisted
    < Server: Jetty(9.2.2.v20140723)
    ````
   
    This change updates the Media Type negotiation logic to instead use the produced content-type if compatible, rather than copying the candidate accept header in some cases.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ericdahl/wink content-type-bug

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/wink/pull/1.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1
   
----
commit f7e17adf2635cb0464c6961f76f2edd3c173de52
Author: Eric Dahl <[hidden email]>
Date:   2014-09-02T00:12:38Z

    Update Accept header content negotiation to not echo back the user's
    accept entry (including the quality flag) but instead use the actual
    content-type.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---