Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAX_URI_LENGTH exceeded results in nonsensical error #113

Open
matthewhively opened this issue Mar 18, 2023 · 2 comments
Open

MAX_URI_LENGTH exceeded results in nonsensical error #113

matthewhively opened this issue Mar 18, 2023 · 2 comments

Comments

@matthewhively
Copy link

matthewhively commented Mar 18, 2023

Webrick version 1.7.0

When MAX_URI_LENGTH of 2083 is exceeded, instead of failing with the expected HTTPStatus::RequestURITooLarge it instead fails with:

ERROR TypeError: can't convert nil into an exact number
	/Users/matthewhively/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.8.1/lib/active_support/core_ext/time/calculations.rb:275:in `-'
	/Users/matthewhively/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.8.1/lib/active_support/core_ext/time/calculations.rb:275:in `minus_with_duration'
	/Users/matthewhively/.rvm/gems/ruby-2.5.7/gems/activesupport-5.2.8.1/lib/active_support/core_ext/time/calculations.rb:286:in `minus_with_coercion'
	/Users/matthewhively/.rvm/gems/ruby-2.5.7/gems/webrick-1.7.0/lib/webrick/accesslog.rb:112:in `setup_params'
	/Users/matthewhively/.rvm/gems/ruby-2.5.7/gems/webrick-1.7.0/lib/webrick/httpserver.rb:223:in `access_log'
	/Users/matthewhively/.rvm/gems/ruby-2.5.7/gems/webrick-1.7.0/lib/webrick/httpserver.rb:115:in `ensure in run'
	/Users/matthewhively/.rvm/gems/ruby-2.5.7/gems/webrick-1.7.0/lib/webrick/httpserver.rb:115:in `run'
	/Users/matthewhively/.rvm/gems/ruby-2.5.7/gems/webrick-1.7.0/lib/webrick/server.rb:310:in `block in start_thread'

httpserver.rb#run() catches the error, but then as part of the ensure block it throws another error.

So the actual issue I suppose is that the ensure block shouldn't be failing, even with some other error condition.

And an additional question:
Why is the MAX_URI_LENGTH remain at a value from 2010 for internet explorer? bd7388d

@ioquatix
Copy link
Member

Can you propose a fix?

@matthewhively
Copy link
Author

If I have some spare time I'll dig into it some more, but for now I'm just happy I figured out the real problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants