Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

MAX_URI_LENGTH exceeded results in nonsensical error

Đang mở
#113 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
ruby
Lĩnh vực
backend, networking

Hướng nghiên cứu

Bắt đầu tại lib/webrick/httpserver.rb#run và lần theo đường dẫn ensure của nó vào access_log, sau đó kiểm tra lib/webrick/accesslog.rb#setup_params. Tái hiện một request vượt quá MAX_URI_LENGTH và xác minh rằng HTTPStatus::RequestURITooLarge mong đợi được giữ nguyên mà không phát sinh TypeError thứ cấp do việc ghi log.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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? https://github.com/ruby/webrick/commit/bd7388dd8e68ba68e74eb0e6f42fcf2753e94deb

Ngôn ngữ chính
Ruby
Star
327
Fork
113
Merge trung bình
4 giờ 2 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ruby/webrick

Tất cả issue của ruby/webrick

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.