aboutsummaryrefslogtreecommitdiffstats
path: root/test/webrick
Commit message (Collapse)AuthorAgeFilesLines
* webrick: fix SNI supportnormal2017-07-181-30/+58
| | | | | | | | | | | * lib/webrick/https.rb: check ssl context of virtual host. * lib/webrick/ssl.rb: ensure to return ssl context. * test/webrick/test_https.rb: test returned cert is correct. [Feature #13729][ruby-dev:50173] Author: Tietew <tietew@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick: add Server Name Indication (SNI)normal2017-07-071-0/+84
| | | | | | | | | | * lib/webrick/https.rb: servername_cb implementation. * lib/webrick/ssl.rb: abstract servername_cb. * test/webrick/test_https.rb: test. [ruby-dev:50165] [Feature #13729] Author: Tietew <tietew@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Import gemspechsbt2017-04-251-0/+2
| | | | | | | | | | 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
* Delay Utils.getservername until needed.shugo2016-12-071-0/+17
| | | | | | | | 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
* webrick: don't use OpenSSL::TestUtils from webrick testsrhe2016-11-291-10/+48
| | | | | | | 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/cgi/cookie.rb (parse): don't allow , as a separator. [Bug #12791]naruse2016-09-271-0/+9
| | | | | | * lib/webrick/cookie.rb (parse): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_ssl_server.rb: fix FD leaknobu2016-08-231-1/+3
| | | | | | | * test/webrick/test_ssl_server.rb (assert_self_signed_cert): close underlying TCP socket to fix FD leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick: filter out HTTP_PROXY for CGIHandlernormal2016-07-222-1/+17
| | | | | | | | | * lib/webrick/httpservlet/cgihandler.rb (do_GET): delete HTTP_PROXY * test/webrick/test_cgi.rb (test_cgi_env): new test * test/webrick/webrick.cgi (do_GET): new endpoint to dump env [ruby-core:76511] [Bug #12610] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Multiple values X-Forwarded-Proto in webricknobu2016-06-211-1/+1
| | | | | | | | | * 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
* webrick/utils.rb: suppress messagesnobu2016-05-091-1/+2
| | | | | | | * test/webrick/utils.rb (TestWEBrick#start_server): suppress progress messages from WEBrick::Utils#create_self_signed_cert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_ssl_server.rb: assert_self_signed_certnobu2016-05-091-13/+9
| | | | | | | * test/webrick/test_ssl_server.rb (assert_self_signed_cert): extract common assertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/ssl.rb: Accept string value for SSLCertName. It is usedhsbt2016-05-071-0/+14
| | | | | | | | 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
* * test/webrick/test_ssl_server.rb: Added basic test for `webrick/ssl`hsbt2016-05-071-0/+28
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpresponse.rb: Move error_body to method. It allow tohsbt2016-03-291-0/+10
| | | | | | | 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
* leakchecker.rb: remove temporary measurenobu2016-01-057-0/+35
| | | | | | | | | | | | | * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#watcher): make watcher thread restartable. * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#terminate): new method to terminate watcher thread. * test/lib/leakchecker.rb (LeakChecker#find_threads): revert r46941. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix common misspelling [ci skip]nobu2015-12-241-1/+1
| | | | | | | * compile.c, cont.c, doc, man: fix common misspelling. [ruby-core:72466] [Bug #11870] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-1615-0/+15
| | | | | | 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
* * test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): gave up the testusa2015-12-061-5/+4
| | | | | | | | 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
* * test/webrick/test_utils.rb (TestWEBrickUtils#test_nested_timeout_outer): seemsusa2015-07-221-2/+2
| | | | | | | 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_filehandler.rb: fix UNC path failurenobu2015-07-141-3/+6
| | | | | | | | * 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
* webrick/test_utils.rb: no timeout during assertionnobu2015-07-141-11/+16
| | | | | | | * test/webrick/test_utils.rb (assert_expired): separate negated assertion and block timeout excecptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/utils.rb: wakeup immediatelynobu2015-07-141-8/+8
| | | | | | | * 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
* test_utils.rb: splitnobu2015-07-141-6/+21
| | | | | | | * test/webrick/test_utils.rb (TestWEBrickUtils#do_tet_timeout): split into tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/server.rb: stop immediatelynobu2015-07-141-0/+4
| | | | | | | | | * 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
* use Timeout.timeoutnobu2015-07-131-1/+1
| | | | | | | * 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
* use assert_raisenobu2015-06-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: Fix regression bug in WEBrick'shsbt2015-03-161-0/+70
| | | | | | | | :DoNotReverseLookup config option implementation. [fix GH-731] Patch by @vais * test/webrick/test_do_not_reverse_lookup.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: Invoke setup_shutdown_pipe in start methodakr2015-03-101-1/+27
| | | | | | | | | instead of listen method. [ruby-core:68476] [Bug #10956] Reported by Shintaro Kojima. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_filehandler.rb: on vboxsf (on VirtualBoxko12015-03-061-4/+10
| | | | | | | | | | | | 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_utils.rb: dynamically chosen port numbernobu2015-01-111-4/+20
| | | | | | | | * 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
* * lib/webrick/utils.rb: removed unused argument variable.hsbt2015-01-021-3/+7
| | | | | | | | | [fix GH-356] Patch by @vipulnsward * lib/webrick/server.rb: ditto. * lib/webrick/ssl.rb: ditto. * test/webrick/test_utils.rb: added test for WEBrick::Utils#create_listeners. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip old OpenSSLnobu2014-12-131-3/+3
| | | | | | | * 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
* * test/lib/envutil.rb: Moved from test/ruby/.akr2014-11-131-1/+0
| | | | | | | | | | | | | | * test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: Setup shutdown pipe in listen method.akr2014-11-101-0/+32
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb (initialize): Initialize shutdown pipe hereakr2014-11-091-0/+4
| | | | | | | | | | | 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
* * test/webrick/webrick.cgi: Don't use debug mode.akr2014-11-092-2/+2
| | | | | | | | * test/webrick/webrick_long_filename.cgi: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/open-uri: Test server log in server thread.akr2014-11-095-45/+104
| | | | | | | | * test/webrick: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick: Fix the argument order of assert_equal.akr2014-11-093-33/+33
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick: Store log in an array.akr2014-11-093-13/+8
| | | | | | | | | | * test/net/http: Ditto. * test/open-uri: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix previous change.akr2014-11-091-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick: Refine log tests.akr2014-11-092-15/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick: Examine log and use assert_join_threads.akr2014-11-085-28/+61
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Close FDs.akr2014-05-302-44/+51
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: Use a pipe to detect server shutdown.akr2014-05-301-1/+0
| | | | | | | | | | | | | | | | 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
* webrick/httpserver.rb: Stop handling requests on shutdownnobu2014-05-081-0/+23
| | | | | | | | | | * 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
* * test: get rid of warnings.usa2014-03-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_addrinfo.rb: remove unused variables.hsbt2014-02-181-2/+0
| | | | | | | | | | | | * test/socket/test_nonblock.rb: ditto. * test/socket/test_socket.rb: ditto. * test/socket/test_unix.rb: ditto. * test/testunit/test_parallel.rb: ditto. * test/webrick/test_filehandler.rb: ditto. * test/xmlrpc/test_features.rb: ditto. * test/zlib/test_zlib.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_httpresponse.rb (test_send_body_*_chunked): theseusa2013-08-081-0/+3
| | | | | | | | 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
* * lib/webrick/httpresponse.rb: Allow #body to be an IO-like objectdrbrain2013-08-071-0/+89
| | | | | | | | | | 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_cgi.rb (TestWEBrickCGI#{start_cgi_server,test_cgi}):usa2013-08-071-2/+2
| | | | | | | mswin is not only mswin32 but also mswin64. [Bug #8746] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e