Rails 升级 2.3.5 后给出错误的标头 -> 2.3.8

发布于 2024-09-04 15:27:54 字数 754 浏览 2 评论 0原文

我刚刚从 Rails 2.3.5 升级到 Rails 2.3.8,但现在我的重定向无法正常工作。

我得到以下响应 HTTP 标头:

HTTP/1.1 302 Moved Temporarily
Date: Wed, 02 Jun 2010 09:40:39 GMT
Content-Length: 93
Content-Type: text/html

而我得到之前的:

HTTP/1.1 302 Moved Temporarily
Connection: close
Date: Wed, 02 Jun 2010 09:41:18 GMT
Set-Cookie: _session_id=<correct id>; path=/
Status: 302 Found
Location: <correct url>
Cache-Control: no-cache
Server: Mongrel 1.1.5
Content-Type: text/html; charset=utf-8
Content-Length: 93

任何人都知道如何解决此问题?尽管重定向不起作用,但登录cookie也没有设置(但我认为,这两者在某种程度上是相关的)。

我已经尝试覆盖redirect_to以设置response.headers['Location']等,但它们没有出现在响应中。

编辑:好吧,这似乎是 mongrel_rails 和 Rails 2.3.8 的一个错误,脚本/服务器没有这个问题。

I just upgraded from rails 2.3.5 to rails 2.3.8, but now my redirects are not working properly.

I get the following as the response HTTP Headers:

HTTP/1.1 302 Moved Temporarily
Date: Wed, 02 Jun 2010 09:40:39 GMT
Content-Length: 93
Content-Type: text/html

whereas I got previous:

HTTP/1.1 302 Moved Temporarily
Connection: close
Date: Wed, 02 Jun 2010 09:41:18 GMT
Set-Cookie: _session_id=<correct id>; path=/
Status: 302 Found
Location: <correct url>
Cache-Control: no-cache
Server: Mongrel 1.1.5
Content-Type: text/html; charset=utf-8
Content-Length: 93

Anyone knows how to fix this? Despite the fact that the redirect is not working, the login-cookie is not set too (but I think, this is both related somehow).

I have already tried to override redirect_to in order to set response.headers['Location'] etc., but they did not appear in the response.

EDIT: Ok, this seems to be a bug with mongrel_rails together with rails 2.3.8, script/server does not have this problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

溇涏 2024-09-11 15:27:54

我相信 Rails 2.3.8 不再支持 mongrel。尝试使用瘦应用程序服务器,您可能不会看到该错误。

I believe rails 2.3.8 no longer supports mongrel. Try with thin app server and you will probably not see that error.

等风也等你 2024-09-11 15:27:54

如果您想继续使用 Mongrel,请访问此链接并向下滚动到 bshand 的评论以获取修复:

https://rails.lighthouseapp.com/projects/8994/tickets/4690-mongrel-doesnt-work-with-rails-238

If you'd rather keep using Mongrel, visit this link and scroll down to the comment by bshand for the fix:

https://rails.lighthouseapp.com/projects/8994/tickets/4690-mongrel-doesnt-work-with-rails-238

╭ゆ眷念 2024-09-11 15:27:54

我通过降级到 2.3.5 修复了位置缺失问题

I fix the Location missing issue by downgrading to 2.3.5

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文