Import gemspec and test file from ruby/webrick.
* webrick.gemspec: Update files and dependency for standalone gem.
* test/webrick/utils.rb: Added explicitly loading of EnvUtil for
test suite without ruby core test suite.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
There is no need to call Utils.getservername when the :ServerName option is
specified, so delay Utils.getservername until needed to avoid unnecessary
DNS lookups. [ruby-core:78492] [Bug #13007]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Follow net/http and open-uri. Don't rely on the constants/methods from
OpenSSL::TestUtils.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/httprequest.rb (setup_forwarded_info): Use the first
value in X-Forwarded-Proto, if header contains multiple comma
separated values. Some middlewares may add these values to the
list, not replacing. [Fix GH-1386]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to invoke ssl server with command line.
[fix GH-1329] Patch by @kerlin
* test/webrick/test_ssl_server.rb: Added test for GH-1329
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
override the body more easily. [fix GH-1307]
* test/webrick/test_httpresponse.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
When you change this to true, you may need to add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
of binary path info test on Windows because the test had passed
occasionally as the comment said.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to be too short for mswin CI. fixed occasional failure introduced at r51235.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/webrick/test_filehandler.rb (test_short_filename): pass
document root path to cmd.exe instead of chdir there, as cmd.exe
does not start on UNC path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#register):
notify the handler thread of new timeout registration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/server.rb (WEBrick::GenericServer#start): flush
shutdown pipe.
* lib/webrick/server.rb (WEBrick::GenericServer#stop): request the
server to stop immediately by sending data via shutdown pipe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time: Object#timeout has been deprecated a long time ago, use
Timeout.timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
on Windows 7), file name and permissions are strange (can access
by short file name and so on).
Simply skip on such tests on such FS. To detect strange FS, this
patch use a part of code `File.executable?(__FILE__)`.
Please correct them if there are better ways.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/webrick/test_utils.rb (test_create_listeners): use
dynamically chosen port number, not hardcoded port number.
[ruby-core:67508]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/open-uri/test_ssl.rb, test/webrick/test_httpproxy.rb: also
depends on test/openssl/utils.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to avoid race condition.
(cleanup_shutdown_pipe): New private method.
(cleanup_listener): Extracted from shutdown method.
Call this method from start method to avoid race condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
shutdown() or close() for listening socket is not a reliable.
Actually, both doesn't work (doesn't wake up select()) on
DragonFly BSD 3.6.2.
* test/webrick/utils.rb: :ShutdownSocketWithoutClose is not required
now to immediate server shutdown detection.
This fixes fd leaks.
* test/net/http/utils.rb: Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/httpserver.rb (WEBrick::HTTPServer#run): stop
handling requests on shutdown, even if the socket is readable
and IO.select() returns true. [Fixes GH-607]
* lib/webrick/server.rb (WEBrick::GenericServer#start): IO.select()
raises ENOTSOCK on shutdown on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
expectations assumes that the IOs are binmode. fixed test failures
introduced at r42427 on Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
that responds to #readpartial and #read.
[ruby-trunk - Feature #8155]
* NEWS: NEWS for above
* test/webrick/test_httpresponse.rb: Tests for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/webrick/test_filehandler.rb (test_script_disclosure): Alternate
Data Stream is available only on NTFS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/webrick/test_filehandler.rb (test_short_filename): use backtick
to reap zombie, instead of leaving opened stream after reading.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e