我使用OmniAuth允许用户使用他们的Google OpenID帐户登录。当我尝试使用WEBrick以开发模式登录时,出现WEBrick :: HTTPStatus :: RequestURITooLarge错误。当我将它部署到我的Rails主机时,它工作正常。 是否有不同的Web服务器,我应该使用,而不是WEBrick?OmniAuth Google OpenID WEBrick :: HTTPStatus :: RequestURITooLarge
17
A
回答
17
奇怪,我不知道WEBrick的URI长度限制是什么。你可以试试thin
http://code.macournoyer.com/thin/。我有时候会在本地使用这个功能,它似乎很好。
11
正如在用于OmniAuth的railscast 236中所提到的,WEBrick在OpenID提供的长url中遇到了问题。给我工作的解决方案是将Mongrel添加到您的gem文件中。
宝石 '杂种', '1.2.0.pre2'
3
的URL大小限制从1024改为2083最新红宝石源了。我希望一个更新版本的红宝石与此修复程序包括即将发布:)
https://github.com/ruby/ruby/blob/trunk/lib/webrick/httprequest.rb#L291
0
我遇到了同样的问题与Caseproof's DataTables gem使用Webbrick和表有很多列(> 15)。切换到瘦服务器也解决了我的问题。 DataTables是一个用于创建表的javascript/jquery插件。
3
将名为webrick.rb
的文件添加到config\initializers
目录。
if defined?(WEBrick::HTTPRequest)
WEBrick::HTTPRequest.const_set("MAX_URI_LENGTH", 10240)
end
相关问题
- 1. WEBrick :: HTTPStatus :: Length Twquio需要
- 2. Google使用Omniauth/OpenID区分www.domain.com和domain.com
- 3. Ruby中的Omniauth + OpenID:弹出的Google OpenID身份验证
- 4. 如何在4月20日之后使用omniauth-openid使用Google-OpenId?
- 5. 谷歌omniauth-openid登录不起作用
- 6. 的WEBrick :: ::的HTTPStatus错误LengthRequired在访问控制器
- 7. 如何禁用发现并为omniauth-openid指定OpenID服务器
- 8. 是否有使用openid的Google登录的omniauth策略?
- 9. 如何使用omniauth-openid gem secure使OpenID登录?
- 10. Rails3和Omniauth-google
- 11. 处理Google OpenID
- 12. Google Openid和Oauth
- 13. OpenId + Bort + google
- 14. Zend OpenId和Google
- 15. Google OpenID openid.return_to
- 16. Rails + Google OpenID
- 17. Django + Google SSO openid
- 18. Redmine Omniauth Google插件
- 19. Google Oauth2 API - Omniauth Rails
- 20. Google OpenID运行Ruby代码的例子?
- 21. Liferay + google openid如何?
- 22. Ruby open_id_authentication with Google OpenID
- 23. Google App Engine和OpenID
- 24. 将Google OpenID迁移到Google应用程序域的OpenID Connect OpenIDs
- 25. Omniauth OpenId身份验证在用户信息中返回nil
- 26. WEBrick:RequestURITooLarge:我应该更新还是使用不同的服务器?
- 27. 的HTTPStatus和DownloadData
- 28. 红宝石和rails与Omniauth - 谷歌和openid错误
- 29. Google帐户的OpenID2正在消失,rails和omniauth
- 30. Rails谷歌登录omniauth
我不得不承认,在网址很长......它包含了很多的查询字符串 – SZH 2011-02-08 13:11:34
我将提交错误与OmniAuth或看看他们是否提供了不使用查询字符串的解决方案。 – raidfive 2011-02-08 18:18:30
薄工作完美! – 2011-08-18 23:35:45