【问题标题】:Getting 411 Length Required Error when using remote link with jQuery Mobile inside android device在 android 设备中使用带有 jQ​​uery Mobile 的远程链接时出现 411 Length Required 错误
【发布时间】:2012-05-20 21:02:29
【问题描述】:

当我在 android 设备中打开一个带有 put/post ajax(remote) 链接的 jQuery Mobile 网站并尝试点击这些链接时出现此错误。在 WebRick 和 Passenger 上运行的 Rails 3.1 会出现问题。如果我使用薄,问题似乎消失了。不过,我更喜欢将Passenger 用于生产服务器。

我应该在Passenger中调整什么来消除这个错误?

【问题讨论】:

  • 尝试安装gem 'mongrel', '>= 1.2.0.pre2'。我的应用程序中的 WebBrick 总是抛出这个消息,然后 mongrel 解决这个问题。

标签: jquery-mobile ruby-on-rails-3.1 passenger thin webrick


【解决方案1】:

事实证明,jQuery Mobile + Android Webkit 的组合存在一些问题,导致带有空正文的 POST 请求引发此错误。我对 Rails ujs 进行了破解,以使用时间戳 ({ timestamp: (new Date()).getTime() }) 的哈希作为任何正文为空的非 GET 请求的正文,问题就消失了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多