aboutsummaryrefslogtreecommitdiffstats
path: root/test/webrick
Commit message (Collapse)AuthorAgeFilesLines
...
* test_cgi.rb: skip a test on Windowsshirosaki2012-10-121-2/+7
| | | | | | | | | * test/webrick/test_cgi.rb (TestWEBrickCGI#test_cgi): skip a test depending on locale on Windows. ENV[] doesn't work properly if console code page is not equal to file system encoding. [ruby-core:47910] [Bug #7140] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb (WEBrick::GenericServer#start):naruse2012-04-141-2/+2
| | | | | | | | | | partially revert r35315. * test/webrick/test_server.rb (test_start_exception): received signal is delivered to the main thread, so it is needed to emulate it. patched by Eric Hodel. [ruby-core:44348] [Feature #6236] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb (WEBrick::GenericServer#stop): fix r35303;naruse2012-04-131-5/+4
| | | | | | | | | this method is to deny new connections, not shutdown yet. * lib/webrick/server.rb (WEBrick::GenericServer#start): re-raise exception only when the exception is Interrupt (^C). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb (module WEBrick::GenericServer): A serverdrbrain2012-04-112-4/+29
| | | | | | | | | | | | | will now continue only when a StandardError subclass is raised. For other exception types the error will be logged at the fatal level and the server will safely stop. Based on a patch by Alex Young. [ruby-trunk - Feature #6236] * test/webrick/test_server.rb: Test for new exception handling behavior. Join the server thread instead of busy-waiting for it to shut down to remove race conditions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Remove unused variables.naruse2012-04-071-4/+4
| | | | | | * use Thread.pass instead of true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpresponse.rb (WEBrick::HTTPResponse#send_body_io):naruse2012-04-071-0/+64
| | | | | | | | use readpartial to get data even if the response is streaming data and each data is smaller than @buffer_size. patched by yu nobuoka. [ruby-dev:45471] [Bug #6230] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpresponse.rb (setup_header): 1xx responsestenderlove2011-12-121-14/+17
| | | | | | | | are allowed to have Keep-Alive connections. * test/webrick/test_httpresponse.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpresponse.rb (setup_header): 204 and 304 responsestenderlove2011-12-121-0/+46
| | | | | | | | are allowed to have a Keep-Alive connection. [ruby-core:41581] * test/webrick/test_httpresponse.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_cgi.rb (TestWEBrickCGI#start_cgi_server): there areusa2011-11-162-2/+2
| | | | | | | | | | | no guarantee of existance of RbConfig::CONFIG['LIBPATHENV']. it only exists in Unix-like environments. * test/webrick/test_filehandler.rb (WEBrick::TestFileHandler#test_script_disclosure): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_cgi.rb (class TestWEBrickCGI): respectkosaki2011-11-122-0/+2
| | | | | | | | | RbConfig::CONFIG["LIBPATHENV"]. [Bug #5135] [ruby-core:38653] * test/webrick/test_filehandler.rb (class WEBrick): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#each):naruse2011-07-211-0/+9
| | | | | | | Allow HTTP/0.9 request which doesn't has any header or body. patched by Felix Jodoin. [ruby-core:38040] [Bug #5022] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove debug print of r32410.naruse2011-07-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpauth/digestauth.rb (_authenticate):naruse2011-07-051-0/+85
| | | | | | | | | | | | Literal texts in HTTP ABNF is case-insensitive (RFC2616 2.1), and a ample implementation in RFC2617 also ignores the case of algorithms. So now this ignores those cases. [ruby-dev:43965] [Feature #4936] * lib/webrick/httpauth/digestauth.rb (initialize): Because of above, opera_hack is useless and removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httprequest.rb (setup_forwarded_info): Parsing request nahi2011-06-241-0/+22
| | | | | | | | | | | | | header failed when the request is from 2 or more Apache reverse proxies. It's said that all X-Forwarded-* headers will contain more than one (comma-separated) value if the original request already contained one of these headers. Since we could use these values as Host header, we choose the initial(first) value. See #4922. * test/webrick/test_httprequest.rb (test_forwarded): Test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpresponse.rb (HTTPResponse#setup_header): Close nahi2011-06-211-0/+27
| | | | | | | | | | HTTP/1.1 connection when returning an IO object as response body without setting HTTPResponse#chunked to true. See #855 no.1. * test/webrick/test_httpserver.rb: Test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/cookie.rb (WEBrick::Cookie.parse): Revert r31228. nahi2011-06-201-14/+21
| | | | | | | | | | | | r31228 was for allowing the 'Cookie:' header which did not have no SP after ';' for separating cookie-pairs but RFC6265 requires single SP after ';' there. We allow multiple SPs here for compatibility with older WEBrick version. * test/webrick/test_cookie.rb: Test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2011-05-152-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fri Apr 1 18:53:06 2011 NAKAMURA, Hiroshi <nahi@ruby-lang.org>nahi2011-04-011-0/+20
| | | | | | | | | | | | | * lib/webrick/cookie.rb (WEBrick::Cookie.parse): 'white space is permitted between tokens' according to RFC2965. Though 'Netscape spec' does not define the syntax clearly, make it tolerant as a server. As a real-world example, rest-client gem sends 'Cookie: foo=1;bar=2' * test/webrick/test_cookie.rb (test_parse_non_whitespace): test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_filehandler.rbusa2011-03-291-1/+4
| | | | | | | | (WEBrick::TestFileHandler#test_short_filename): the cgi doesn't exist on current directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_filehandler.rb (test_short_filename):arton2011-03-281-2/+6
| | | | | | | | read real short filename by cmd because smb mounted files have different naming convention. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/utils.rb (TestWEBrick::RubyBin): test CGI does not needusa2011-01-201-0/+1
| | | | | | | | to load rubygems. if it activated, ruby raises LoadError about rbconfig.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Reduced gem_prelude to just require rubygems. Reviewed by Evan Phoenixryan2011-01-141-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Simple fix for emacs parsing. (emacs doesn't like _heredocs_)ryan2011-01-121-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_cgi.rb: Removes usage of deprecatednaruse2011-01-123-6/+24
| | | | | | | | | | | | :RequestHandler option. patched by Peter Weldon [ruby-core:34010] * test/webrick/test_httpproxy.rb: ditto. * test/webrick/test_httpserver.rb: Add a test of the deprecation behaviour. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix test for r29617.naruse2010-10-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_httpproxy.rb (TestWEBrickHTTPProxy::test_upstream_proxy):shyouhei2010-10-011-0/+1
| | | | | | | My machine fails this test at this line, saying 503 service unavailable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#continue): addnahi2010-09-101-0/+31
| | | | | | | | | | | method for generating HTTP/1.1 100 continue response if the client expects it, otherwise does nothing. Patch by Brian Candler. ref #855. * test/webrick/test_httprequest.rb: test added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* don't sleep indefinitely. collect the zombie.akr2010-05-071-3/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r26058 "* test/webrick/test_server.rb (test_daemon): simply use ↵naruse2010-05-071-2/+8
| | | | | | | | fork's return" This must use pipe because the target for kill is not direct child. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use require_relative.akr2010-02-025-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* supress warnings.akr2010-01-251-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpservlet/filehandler.rb (make_partial_content):nobu2010-01-181-0/+66
| | | | | | | add bytes-unit. [ruby-dev:40030] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_cgi.rb: require util.rb first to override thenobu2010-01-181-1/+1
| | | | | | | executable name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/envutil.rb (EnvUtil#rubybin): fake also rbconfig.nobu2010-01-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/accesslog.rb : Escape needed.shyouhei2010-01-101-0/+32
| | | | | | | | | | | | | * lib/webrick/httpstatus.rb : ditto. * lib/webrick/httprequest.rb : ditto. * lib/webrick/httputils.rb : ditto. * test/webrick/test_cgi.rb (TestWEBrickCGI::test_bad_): Test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/test_server.rb (test_daemon): simply use fork's returnnaruse2009-12-101-8/+2
| | | | | | value, don't use pipe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test: use require_relative.naruse2009-09-121-7/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-064-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick/utils.rb (start_server): provide a reference to log ofmame2008-10-297-140/+147
| | | | | | | | | | | | webrick. * test/webrick/test_httpproxy.rb, test/webrick/test_httpauth.rb, test/webrick/test_cgi.rb, test/webrick/test_httpserver.rb, test/webrick/test_server.rb, test/webrick/test_filehandler.rb: use webrick log as an assertion message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test: assert_raises has been deprecated since a long time ago.nobu2008-09-244-30/+30
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/cgi.rb (WEBrick::CGI::Socket#eof?): added lacked method.gotoyuzo2008-08-171-3/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test material for r16453.gotoyuzo2008-05-182-0/+37
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpservlet/filehandler.rb: should normalize pathgotoyuzo2008-05-183-11/+92
| | | | | | | | | | | | | | | | | | name in path_info to prevent script disclosure vulnerability on DOSISH filesystems. (fix: CVE-2008-1891) Note: NTFS/FAT filesystem should not be published by the platforms other than Windows. Pathname interpretation (including short filename) is less than perfect. * lib/webrick/httpservlet/abstract.rb (WEBrick::HTTPServlet::AbstracServlet#redirect_to_directory_uri): should escape the value of Location: header. * lib/webrick/httpservlet/cgi_runner.rb: accept interpreter command line arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpservlet/filehandler.rb: should normalize pathgotoyuzo2008-03-031-0/+59
| | | | | | | | | | | | separators in path_info to prevent directory traversal attacks on DOSISH platforms. reported by Digital Security Research Group [DSECRG-08-026]. * lib/webrick/httpservlet/filehandler.rb: pathnames which have not to be published should be checked case-insensitively. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httprequest.rb: supprt X-Forwarded-* header fields.gotoyuzo2008-01-091-0/+67
| | | | | | | | | | | | | | WEBrick::HTTPRequest#{host,port,request_uri} is derived having regards to X-Forwarded-Proto and X-Forwarded-Host. * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#server_name?): new method. (WEBrick::HTTPRequest#remote_ip?): new method. (WEBrick::HTTPRequest#ssl?): new method. * string.c (rb_enc_cr_str_buf_cat): fix self appending. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#proxy_service):gotoyuzo2007-12-312-3/+288
| | | | | | | | | | call do_XXX which corespond with request method. (WEBrick::HTTPProxyServer#do_CONNECT,do_GET,do_POST,do_HEAD): added. * test/webrick/test_httpproxy.rb: add test for WEBrick::HTTPProxyServer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httprequest.rb, lib/webrick/cgi.rb: Request-Line orgotoyuzo2007-12-171-0/+10
| | | | | | | header fields shold be read with maximum length. [ruby-talk:231745] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/xmlrpc/create.rb (XMLRPC::Create::conv2value): Symbol shouldmatz2006-11-021-1/+1
| | | | | | | | | | | | | | | | | | | come earlier than String. * lib/soap/mapping/rubytypeFactory.rb (RubytypeFactory::obj2soap): ditto. * lib/set.rb (TC_Set::test_s_new): strings are no longer Enumerable * lib/soap/property.rb (Property::load): ditto. * lib/webrick/httputils.rb (WEBrick::HTTPUtils::parse_header): ditto. * lib/soap/mimemessage.rb (MIMEMessage::Headers::parse): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/cookie.rb (WEBrick::Cookie.parse_set_cookies): newgotoyuzo2006-09-081-0/+31
| | | | | | | | | method to parse multiple cookies per Set-Cookie header. Thanks to Aaron Patterson <aaron_patterson at speakeasy.net>. [ruby-core:08802] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httprequest.rb (WEBrick::HTTPReuqest#parse_uri): improvegotoyuzo2006-07-311-0/+58
| | | | | | | for the value of IPv6 address in the Host: header field. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e