Skip to content

Don't fail on RPC withAccept: text/plain, application/json #2170

Closed
@steve-chavez

Description

@steve-chavez

A request like :

GET /rpc/jsonfunc
Accept: text/plain, application/json

Gives 406 Not Acceptable. We prefer text/plain in this case because both q values are 1.0 by default and there's an order preference. If it were Accept: text/plain; q=0.2, application/json; q=0.8, then application/json would be picked and the request would succeed.

The RFC doesn't specify that ordering is relevant according to this so answer. So we could give preference to application/json over text/plain, because the latter is only supported on certain conditions while the former is supported on every request.

The problem comes from #2162 (reply in thread).

This might require patching parseHttpAccept.

Metadata

Metadata

Assignees

No one assigned

    Labels

    httphttp compliance

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions