couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olafura <>
Subject [GitHub] couchdb pull request: Backport Accept check from chttpd
Date Fri, 28 Nov 2014 14:54:26 GMT
Github user olafura commented on the pull request:
    @rnewson That thing is that the change was a non feature, it added constraints to the
pattern matching so it would pick up **q= value**, which breaks any comparison you can make.
Because browsers say they support really anything with that value:

    Every framework it seems at some point has someone that adds support for those thing and
everything breaks.
    The reason why the initial patch didn't break badly at first is that it only did the comparison
on `text/html`, which kind of works. But then people added it also to `application/json`,
and added that first which totally broke everything.
    The intentions were good and I have a patch which is stricter about matching it to `text/html`
and `application/json` that can be merged. But please don't try to propagate this bug to **chttp**.
    If you do a web search you can find a lot of bugs caused by respecting the q value plus
wild card usage when doing comparisons. It's also an overkill, it does not add any value,
just takes it away.
    The browsers say with the `Accept` header, please bring us something in these format,
but anything is also fine with us.
    My test takes a real world use of the `Accept` header and most of the versions **CouchDB**
fail it which is really bad.
    There are three options:
    *  Keep the patch like it is
    *  Update the patch with stricter matching for the full `application/json` and `text/html`,
which is in the comments.
    *  Update the patch to select the quality of the matching, so to return the one the the
client prefers, this is the most correct solution and I'll make a patch that implements this,
if you choose so.
    I'll also make patches for **chttp** for the two latter options if you choose that. //The *q-value*, if any, is ignored. //possibly a better way of doing it but
I don't thing for this usecase needed

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 or file a JIRA ticket
with INFRA.

View raw message