Skip to content

content_type is not automatically set #185

Closed
brandonweiss opened this Issue Mar 14, 2012 · 4 comments

3 participants

@brandonweiss

I'm not sure if this is intended or not, but I was surprised to see RABL setting the content_type to text/html when the format was set to JSON. I wound up having to manually set the content_type for all responses to application/json. Is this a bug, working as intended, or am I doing something wrong?

@nesquena
Owner

I use sinatra and rabl together mostly and I just set the content type in a before filter. If RABL did set the content type, I would want that to support Rails, Sinatra and Padrino. Right now its left up to the user since rabl supports json/xml/msgpack/etc it was something that was never automated. Patches welcome though :)

@brandonweiss

Ah yeah, in retrospect that makes sense, I just wasn't expecting it. That should probably be added to the readme so other people don't get bit by it, until RABL detects frameworks and sets it accordingly.

@nesquena
Owner

Good idea, I will add it to the readme soon, thanks for the feedback

@databyte
Collaborator
databyte commented Apr 6, 2012

README was updated, closing.

@databyte databyte closed this Apr 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.