我们有小型的Sinatra应用程序,运行在REE 1.8.7p-358上
NewRelic报告了一些类似的问题:
RegexpError: Stack overflow in regexp matcher: /\A(?:%[0-9a-fA-F]{2}|[^%])*\z/
.../gems/rack-1.4.1/lib/rack/backports/uri/common_18.rb: 67:in `decode_www_form_component'
.../gems/rack-1.4.1/lib/rack/utils.rb: 43:in `unescape'
.../gems/rack-1.4.1/lib/rack/utils.rb: 88:in `parse_nested_query'
.../gems/rack-1.4.1/lib/rack/utils.rb: 88:in `map'
.../gems/rack-1.4.1/lib/rack/utils.rb: 88:in `parse_nested_query'
.../gems/rack-1.4.1/lib/rack/utils.rb: 87:in `each'
.../gems/rack-1.4.1/lib/rack/utils.rb: 87:in `parse_nested_query'
.../gems/rack-1.4.1/lib/rack/request.rb: 334:in `parse_query'
.../gems/rack-1.4.1/lib/rack/request.rb: 209:in `POST'
.../gems/rack-1.4.1/lib/rack/request.rb: 221:in `params'
.../gems/sinatra-1.2.6/lib/sinatra/base.rb: 638:in `call!'
.../gems/sinatra-1.2.6/lib/sinatra/base.rb: 629:in `call'
从Rack来源我看到它使用/\A(?:%[0-9a-fA-F]{2}|[^%])*\z/
来检测无效的%-encoding:
raise ArgumentError, "invalid %-encoding (#{str})" unless /\A(?:%[0-9a-fA-F]{2}|[^%])*\z/ =~ str
我想尝试在本地重现错误。
我的问题是:在尝试将其与/\A(?:%[0-9a-fA-F]{2}|[^%])*\z/