使用 RABL 从 Rails 3 应用程序返回不完整的响应正文 [英] Incomplete response body being returned from Rails 3 app with RABL

查看:36
本文介绍了使用 RABL 从 Rails 3 应用程序返回不完整的响应正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Rails 3 和 RABL 构建了一个 JSON API

I've built a JSON API using Rails 3 and RABL

API 运行良好,但对于特定请求,仅返回部分数据 - 其余 JSON 被截断.由于 JSON 因此无效,依赖该 API 的移动应用程序崩溃.

The API works well but on particular requests only part of the data is returned - the rest of the JSON is cut off. Since the JSON is therefore invalid, the mobile app which relies on the API is crashing.

有人能想出为什么身体被切断到一定的尺寸并为我指出解决问题的正确方向吗?谢谢

Can anybody think of why the body is cut off at a certain size and point me in the right direction to resolve the issue? Thanks

推荐答案

所以我能够将这个问题追溯到乘客

So I was able to track this issue down to Passenger

长话短说,我通过在乘客配置中设置 passenger_buffer_response off; 来修复它.

Long story short I fixed it by setting passenger_buffer_response off; in my passenger configs.

这篇关于使用 RABL 从 Rails 3 应用程序返回不完整的响应正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆