Граф коммитов

120 Коммитов

Автор SHA1 Сообщение Дата
hsbt 33f66084d5 Import gemspec
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
2017-04-25 09:23:04 +00:00
shugo 03ec739729 Delay Utils.getservername until needed.
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
2016-12-07 12:59:48 +00:00
rhe db31f2fafb webrick: don't use OpenSSL::TestUtils from webrick tests
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
2016-11-29 15:48:47 +00:00
naruse 5f33c6b0f5 * lib/cgi/cookie.rb (parse): don't allow , as a separator. [Bug #12791]
* lib/webrick/cookie.rb (parse): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-27 03:17:47 +00:00
nobu d3e7e3cc8b test_ssl_server.rb: fix FD leak
* 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
2016-08-23 02:05:24 +00:00
normal dafeebf12d webrick: filter out HTTP_PROXY for CGIHandler
* 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
2016-07-22 16:43:12 +00:00
nobu 978ee6d1ef Multiple values X-Forwarded-Proto in webrick
* 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
2016-06-21 10:32:26 +00:00
nobu abfc0b18d5 webrick/utils.rb: suppress messages
* 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
2016-05-09 00:05:32 +00:00
nobu 4a46404a71 test_ssl_server.rb: assert_self_signed_cert
* 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
2016-05-09 00:05:30 +00:00
hsbt a6e805f75e * lib/webrick/ssl.rb: Accept string value for SSLCertName. It is used
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
2016-05-07 13:37:18 +00:00
hsbt b39d4eac28 * test/webrick/test_ssl_server.rb: Added basic test for `webrick/ssl`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-07 12:55:17 +00:00
hsbt c2355aefc9 * lib/webrick/httpresponse.rb: Move error_body to method. It allow to
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
2016-03-29 03:45:32 +00:00
nobu 8d66627161 leakchecker.rb: remove temporary measure
* 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
2016-01-05 06:09:17 +00:00
nobu 22d8481f08 fix common misspelling [ci skip]
* 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
2015-12-24 23:23:46 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
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
2015-12-16 05:07:31 +00:00
usa 52047a145b * test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): gave up the test
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
2015-12-06 09:28:02 +00:00
usa 2f5897e6b6 * test/webrick/test_utils.rb (TestWEBrickUtils#test_nested_timeout_outer): seems
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
2015-07-22 09:04:57 +00:00
nobu f77967ad73 test_filehandler.rb: fix UNC path failure
* 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
2015-07-14 04:55:13 +00:00
nobu 1c4fe8df9f webrick/test_utils.rb: no timeout during assertion
* 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
2015-07-14 04:55:03 +00:00
nobu 7d909eb218 webrick/utils.rb: wakeup immediately
* 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
2015-07-14 02:22:51 +00:00
nobu 18d47904a4 test_utils.rb: split
* 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
2015-07-14 02:20:34 +00:00
nobu 77cde58d39 webrick/server.rb: stop immediately
* 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
2015-07-14 02:20:16 +00:00
nobu beb1c085d5 use Timeout.timeout
* 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
2015-07-13 10:07:01 +00:00
nobu ae042f21fb use assert_raise
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02 02:18:44 +00:00
hsbt 7d75a78604 * lib/webrick/server.rb: Fix regression bug in WEBrick's
: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
2015-03-16 08:43:28 +00:00
akr ab0a64e1c8 * lib/webrick/server.rb: Invoke setup_shutdown_pipe in start method
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
2015-03-10 11:05:21 +00:00
ko1 3859d767e1 * test/webrick/test_filehandler.rb: on vboxsf (on VirtualBox
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
2015-03-06 09:22:21 +00:00
nobu 7c4d749d18 test_utils.rb: dynamically chosen port number
* 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
2015-01-11 06:11:40 +00:00
hsbt 73fc0cc572 * lib/webrick/utils.rb: removed unused argument variable.
[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
2015-01-02 06:53:12 +00:00
nobu 21a40e94ac skip old OpenSSL
* 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
2014-12-13 07:12:56 +00:00
akr fb2008a73a * test/lib/envutil.rb: Moved from test/ruby/.
* 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
2014-11-13 16:05:37 +00:00
akr 33bb38a644 * lib/webrick/server.rb: Setup shutdown pipe in listen method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 11:05:00 +00:00
akr 2a9ea11355 * lib/webrick/server.rb (initialize): Initialize shutdown pipe here
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
2014-11-09 23:03:40 +00:00
akr ed50872b30 * test/webrick/webrick.cgi: Don't use debug mode.
* test/webrick/webrick_long_filename.cgi: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09 20:58:22 +00:00
akr ad58f04833 * test/open-uri: Test server log in server thread.
* test/webrick: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09 14:01:20 +00:00
akr b0132150c6 * test/webrick: Fix the argument order of assert_equal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09 12:16:38 +00:00
akr 070c310e87 * test/webrick: Store log in an array.
* 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
2014-11-09 11:51:06 +00:00
akr ee0b5fbd53 Fix previous change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09 01:17:14 +00:00
akr 7044cea301 * test/webrick: Refine log tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-09 00:51:12 +00:00
akr 742bbbb01b * test/webrick: Examine log and use assert_join_threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-08 15:38:33 +00:00
akr 69105a1724 Close FDs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-30 14:50:42 +00:00
akr 6f226d9d42 * lib/webrick/server.rb: Use a pipe to detect server shutdown.
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
2014-05-30 12:32:48 +00:00
nobu 719804b5df webrick/httpserver.rb: Stop handling requests on shutdown
* 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
2014-05-08 01:17:07 +00:00
usa 5543a55b52 * test: get rid of warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-11 04:22:34 +00:00
hsbt 93156392dd * test/socket/test_addrinfo.rb: remove unused variables.
* 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
2014-02-18 12:05:09 +00:00
usa 647fc21a35 * test/webrick/test_httpresponse.rb (test_send_body_*_chunked): these
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
2013-08-08 03:14:15 +00:00
drbrain 9dff71ad78 * lib/webrick/httpresponse.rb: Allow #body to be an IO-like object
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
2013-08-07 18:38:39 +00:00
usa d3831282fc * test/webrick/test_cgi.rb (TestWEBrickCGI#{start_cgi_server,test_cgi}):
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
2013-08-07 07:39:23 +00:00
nobu 0e8fc182e3 test_filehandler.rb: fix for non-NTFS
* 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
2013-06-21 06:15:36 +00:00
nobu afc75f2284 test_filehandler.rb: reap zombie
* 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
2013-06-21 06:15:34 +00:00