Backport #2593
closedWEBrickのContent-RangeがRFCに準拠していない
Description
=begin
[ruby-dev:29894]でも指摘されていましたが、
WEBrickのContent-RangeがRFCに準拠していないようです。
RFCではContent-Rangeは以下のように定義されているようですが、
bytes-unitの部分がWEBrickから出力されていません。
Content-Range = "Content-Range" ":" content-range-spec content-range-spec = byte-content-range-spec byte-content-range-spec = bytes-unit SP byte-range-resp-spec "/" ( instance-length | "*" ) byte-range-resp-spec = (first-byte-pos "-" last-byte-pos) | "*" instance-length = 1*DIGIT
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16
具体的な不都合としては、iPhoneへのmp4配信が出来ません。
=end
Files
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r26346.
Kunimi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
Updated by shyouhei (Shyouhei Urabe) about 14 years ago
- Status changed from Closed to Assigned
- Assignee set to shyouhei (Shyouhei Urabe)
=begin
=end
Updated by shyouhei (Shyouhei Urabe) almost 14 years ago
- Status changed from Assigned to Closed
=begin
This issue was solved with changeset r27918.
Kunimi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
Updated by kimuraw (Wataru Kimura) almost 14 years ago
- File patch-test-webrick.diff patch-test-webrick.diff added
- File patch-lib-net-http.rb.diff patch-lib-net-http.rb.diff added
=begin
追加されたテストが次のようにエラーになります。
ruby 1.8.7 (2010-06-10 patchlevel 294) [i686-darwin10.3.0]で確認しました。
- Error:
test_filehandler(WEBrick::TestFileHandler):
NameError: undefined local variable or methodlog' for #<WEBrick::TestFileHandler:0x103637b40> ./test/webrick/test_filehandler.rb:96:in
test_filehandler'
/Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1054:inrequest' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:2144:in
reading_body'
/Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1053:inrequest' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1037:in
request'
/Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:543:instart' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1035:in
request'
./test/webrick/test_filehandler.rb:95:intest_filehandler' ./test/webrick/utils.rb:38:in
call'
./test/webrick/utils.rb:38:instart_server' ./test/webrick/utils.rb:46:in
start_httpserver'
./test/webrick/test_filehandler.rb:79:in `test_filehandler'
====
1.8からもってきたテストコードが不足しているようです。
添付したパッチpatch-test-webrick.diffでテストが実行できるようになります。
また、このパッチを当てるとテストの実行結果は以下のようになります。¶
- Failure:
test_filehandler(WEBrick::TestFileHandler)
[./test/webrick/test_filehandler.rb:100:intest_filehandler' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1054:in
request'
/Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:2144:inreading_body' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1053:in
request'
/Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1037:inrequest' /Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:543:in
start'
/Volumes/CHome/kimuraw/work/ruby-1.8.7/lib/net/http.rb:1035:inrequest' ./test/webrick/test_filehandler.rb:95:in
test_filehandler'
./test/webrick/utils.rb:44:incall' ./test/webrick/utils.rb:44:in
start_server'
./test/webrick/utils.rb:52:instart_httpserver' ./test/webrick/test_filehandler.rb:79:in
test_filehandler']:
webrick log start:
[2010-06-11 02:43:53] INFO WEBrick 1.3.1
[2010-06-11 02:43:53] INFO ruby 1.8.7 (2010-06-10) [i686-darwin10.3.0]
[2010-06-11 02:43:53] INFO WEBrick::HTTPServer#start: pid=25412 port=52634
webrick log end.
<9285..9384> expected but was
<9285..9385>.
====
これは1.8のr27918でのNet::HTTPHeader#content_rangeの修正が
1.8.7に反映されていないためだと思います。
http://redmine.ruby-lang.org/issues/show/2688
添付したパッチpatch-lib-net-http.rb.diffでテストをパスするようになります。
=end
Updated by shyouhei (Shyouhei Urabe) almost 14 years ago
- Status changed from Closed to Assigned
=begin
ふむ。ありがとうございます。なぜ気付かなかったよくわかりませんが、そのへんも含めて調査してみます。
=end
Updated by shyouhei (Shyouhei Urabe) almost 14 years ago
- Status changed from Assigned to Closed
=begin
This issue was solved with changeset r28336.
Wataru, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end