OmniAuth Google OpenID WEBrick::HTTPStatus::RequestURITooLarge

后端 未结 5 1694
礼貌的吻别
礼貌的吻别 2020-12-17 14:20

I am using OmniAuth to allow users to log in with their Google OpenID accounts. When I try to log in in development mode with WEBrick, I get a WEBrick::HTTPStatus::RequestUR

相关标签:
5条回答
  • 2020-12-17 14:48

    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.

    0 讨论(0)
  • 2020-12-17 14:53

    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'

    0 讨论(0)
  • 2020-12-17 14:54

    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.

    0 讨论(0)
  • 2020-12-17 15:00

    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

    0 讨论(0)
  • 2020-12-17 15:01

    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
    
    0 讨论(0)
提交回复
热议问题