Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demonstrate failing specs due to rack-accept parsing of media-type headers with underscores #985

Closed

Conversation

jerrod
Copy link

@jerrod jerrod commented Apr 14, 2015

The purpose of this pull request is to illuminate the issues with the Header versioning strategy when the vendor header uses an underscore _.

I have a pull request to address the parsing issues for rack-accept, however this change has the effect of breaking the recognition of Content-Types when using media_type headers.

Unfortunately I do not see a good way to address both of these issues while still relying on rack-accept for media_type and vendor parsing, so this is meant to start the conversation about how to address these issues.

[see also: https://github.com/mjackson/rack-accept/pull/17 ]

@dblock
Copy link
Member

dblock commented Apr 14, 2015

It does look though that the problem is rack-accept and mjackson/rack-accept#17 fixes it. I suggest reaching out to the contributors of rack-accept and getting someone to take a look to get that merged? @mjackson really.

@jerrod
Copy link
Author

jerrod commented Apr 15, 2015

I agree - my main concern with just having rack-accept patched and the dependency updated in Grape is that once we started using our own patched rack-accept we started also seeing the need to pass a very specific media type with Content-Type on any request with a body - e.g. passing application/json no longer worked an instead we needed to match the Accept header - as in application/vnd.whole_vendor_name-V1+JSON which seems wrong.

I am unable to determine if this is due to rack-accept or if this is handled in Grape, so any insight would be great if you have any.

@dblock
Copy link
Member

dblock commented Apr 15, 2015

Run this test you have here with code from mjackson/rack-accept#17, does the spec pass?

@jerrod jerrod closed this Aug 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants