Skip to content
New issue

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

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

Already on GitHub? # to your account

content_type is not automatically set #185

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

content_type is not automatically set #185

brandonweiss opened this issue Mar 14, 2012 · 4 comments

Comments

@brandonweiss
Copy link

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
Copy link
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
Copy link
Author

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
Copy link
Owner

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

@databyte
Copy link
Collaborator

databyte commented Apr 6, 2012

README was updated, closing.

@databyte databyte closed this as completed Apr 6, 2012
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants