Changing so if Accept header is explicitly set, sending json does not ov... #479

Merged
merged 1 commit into from Mar 15, 2013

Projects

None yet

2 participants

@RoryH
Contributor
RoryH commented Mar 15, 2013

This change handles a case where the user has set the Accept header (other than application/json) for the request and wants to send JSON. Accept header is not overwritten.
A valid use case for this is a REST API where the API expects a custom Accept header for versioning reasons (i.e. application/vnd.custom.v1+json)

@RoryH RoryH Changing so if Accept header is explicitly set, sending json does not…
… overwrite.

This change handles a case where the user has set the Accept header (other than application/json) for the request and wants to send JSON. Accept header is not overwritten.
A valid use case for this is a REST API where the API expects a custom Accept header for versioning reasons (i.e. application/vnd.custom.v1+json)
8f8bb9e
@mikeal
Member
mikeal commented Mar 15, 2013

I'm taking this but we really need to implement a caseless hasHeader method to avoid all this code duplication checking headers.

@mikeal mikeal merged commit e92e67a into request:master Mar 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment