Project

General

Profile

Actions

Bug #4110

closed

ホスト名の先頭が数字であるとき、WEBrickのテストでErrorが出る

Added by kyanagi (Kouhei Yanagita) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-12-02 trunk 30021) [x86_64-linux]
Backport:
[ruby-dev:42672]

Description

=begin
ホスト名の先頭が数字であるような環境において、WEBrickのテストでErrorが出ます。

これは、WEBrick::HTTPRequest#parse_uriの中においてURI#host=でホスト名を設定する際、
先頭が数字であるような(ドットを含まない)ホスト名は許されないので例外が発生しているためです。

ひとまず、設定の:ServerNameを'localhost'にしてみたらテストは通りました。

$ ~/local/ruby-trunk/bin/ruby -v test/webrick/test_filehandler.rb
ruby 1.9.3dev (2010-12-02 trunk 30021) [x86_64-linux]
test/webrick/test_filehandler.rb:187: warning: assigned but unused variable - this_file
test/webrick/test_filehandler.rb:202: warning: assigned but unused variable - this_file
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/minitest/unit.rb:623: warning: assigned but unused variable - ac
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/minitest/unit.rb:624: warning: assigned but unused variable - tc
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - canon
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - sw
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - cn
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:446: warning: shadowing outer local variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:13536: warning: assigned but unused variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:447: warning: shadowing outer local variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:13536: warning: assigned but unused variable - s
Run options:

Running tests:

..E....

Finished tests in 0.657798s, 10.6416 tests/s, 83.6123 assertions/s.

  1. Error:
    test_make_partial_content(WEBrick::TestFileHandler):
    WEBrick::HTTPStatus::BadRequest: bad URI /'. test/webrick/test_filehandler.rb:35:in make_range_response'
    test/webrick/test_filehandler.rb:47:in `test_make_partial_content'

7 tests, 55 assertions, 0 failures, 1 errors, 0 skips

$ ~/local/ruby-trunk/bin/ruby -v test/webrick/test_httprequest.rb
ruby 1.9.3dev (2010-12-02 trunk 30021) [x86_64-linux]
test/webrick/test_httprequest.rb:321: warning: ambiguous first argument; put parentheses or even spaces
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/minitest/unit.rb:623: warning: assigned but unused variable - ac
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/minitest/unit.rb:624: warning: assigned but unused variable - tc
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - canon
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - sw
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:232: warning: assigned but unused variable - cn
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:446: warning: shadowing outer local variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:14640: warning: assigned but unused variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:447: warning: shadowing outer local variable - s
/home/yanagi/local/ruby-trunk/lib/ruby/1.9.1/optparse.rb:14640: warning: assigned but unused variable - s
Run options:

Running tests:

..EE.EEE.E....

Finished tests in 0.015776s, 887.4239 tests/s, 3866.6329 assertions/s.

  1. Error:
    test_continue_not_sent(TestWEBrickHTTPRequest):
    WEBrick::HTTPStatus::BadRequest: bad URI /path'. test/webrick/test_httprequest.rb:332:in test_continue_not_sent'

  2. Error:
    test_continue_sent(TestWEBrickHTTPRequest):
    WEBrick::HTTPStatus::BadRequest: bad URI /path'. test/webrick/test_httprequest.rb:316:in test_continue_sent'

  3. Error:
    test_parse_09(TestWEBrickHTTPRequest):
    WEBrick::HTTPStatus::BadRequest: bad URI /'. test/webrick/test_httprequest.rb:12:in test_parse_09'

  4. Error:
    test_parse_10(TestWEBrickHTTPRequest):
    WEBrick::HTTPStatus::BadRequest: bad URI /'. test/webrick/test_httprequest.rb:29:in test_parse_10'

  5. Error:
    test_parse_11(TestWEBrickHTTPRequest):
    WEBrick::HTTPStatus::BadRequest: bad URI /path'. test/webrick/test_httprequest.rb:46:in test_parse_11'

  6. Error:
    test_parse_header2(TestWEBrickHTTPRequest):
    WEBrick::HTTPStatus::BadRequest: bad URI /foo/bar/../baz?q=a'. test/webrick/test_httprequest.rb:117:in test_parse_header2'

14 tests, 61 assertions, 0 failures, 6 errors, 0 skips
=end


Files

fix_webrick_test.diff (9.26 KB) fix_webrick_test.diff kyanagi (Kouhei Yanagita), 12/02/2010 10:22 PM

Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #2542: URI lib should be updated to RFC 3986Closednaruse (Yui NARUSE)01/01/2010Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0