OmniAuth Google OpenID WEBrick::HTTPStatus::RequestURITooLarge

非 Y 不嫁゛ 提交于 2019-11-29 05:38:44

Strange, I wonder what the URI length limit is for WEBrick. You could try thin http://code.macournoyer.com/thin/. I use this locally for development sometimes and it seems to work great.

As mentioned in railscast 236 for OmniAuth, WEBrick has trouble with long urls given by OpenID. The solution given that worked for me was to add Mongrel to your gemfile.

gem 'mongrel', '1.2.0.pre2'

Add a file called webrick.rb file to the config\initializers directory.

if defined?(WEBrick::HTTPRequest)
  WEBrick::HTTPRequest.const_set("MAX_URI_LENGTH", 10240)
end

The url size limit changed from 1024 to 2083 in the latest ruby source already. I hope an updated ruby version with this fix included will be released soon :)

https://github.com/ruby/ruby/blob/trunk/lib/webrick/httprequest.rb#L291

I ran into this same issue with Caseproof's DataTables gem using Webbrick and a table that had a lot of columns (> 15). Switching to the thin server resolved my issue as well. DataTables is a javascript/jquery plugin for creating tables.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!