aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
Commit message (Collapse)AuthorAgeFilesLines
* CIDR in no_proxynobu2016-02-131-0/+8
| | | | | | | * lib/uri/generic.rb (URI::Generic#find_proxy): support CIDR in no_proxy. [ruby-core:73769] [Feature#12062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* no_proxy with whitespaces and leading dotsnobu2016-02-131-0/+4
| | | | | | | | | | | | | | | | | * lib/uri/generic.rb (find_proxy): exclude white-spaces and allow for a leading dot in the domain name in no_proxy. [ruby-core:54542] [Feature #8317] The previous implementation wouldn't allow for white-spaces nor a leading dot in the domain name. The latter is described in the wget documentation as a valid case. By being more strict on the characters, which are counted to a domainname, we allow for white-spaces. Also, a possible leading dot will be handled gracefully. [Fix GH-285] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/uri/test_generic.rb: split test_find_proxynobu2016-02-131-5/+20
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* domainname no_proxy assertionsnobu2016-02-131-0/+4
| | | | | | | * test/uri/test_generic.rb (test_find_proxy): assertions for no_proxy of domainname. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic#to_s): change encoding tonaruse2016-01-141-0/+1
| | | | | | | UTF-8 as Ruby 2.2/ by Koichi ITO <koic.ito@gmail.com> https://github.com/ruby/ruby/pull/1188 fix GH-1188 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-167-0/+7
| | | | | | 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_generic.rb: fix assertionnobu2015-12-081-1/+1
| | | | | | * test/uri/test_generic.rb (test_to_s): use assert_not_predicate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/uri/test_generic.rb (to_s): new testnormal2015-12-081-0/+7
| | | | | | | | | | Ensure URI::Generic#to_s continues to return mutable strings to prevent breakage when we enable frozen string literals in future commits. [ruby-core:71820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/rfc2396_parser.rb (initialize_pattern):naruse2015-05-191-0/+4
| | | | | | | | | URI::Generic.build should accept port as a string. pattern[:PORT] is not defined for long. by Dave Slutzkin <daveslutzkin@fastmail.fm> https://github.com/ruby/ruby/pull/804 fix GH-804 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/mailto.rb: raising URI::InvalidComponentError insteadduerst2015-01-141-0/+3
| | | | | | | | of failing with undefined method `split' for nil:NilClass for mailto: URIs without opaque part. [Bug #10738] * test/uri/testuri.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic#query=): don't escape [\]^naruse2014-12-231-2/+2
| | | | | | on both rfc2396 and rfc3986. [Bug #10619] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic.build):naruse2014-12-011-3/+17
| | | | | | | | | | | | | | use hostname= to detect and wrap IPv6 hosts. Build is accepting URI components and users may not expect that a host component needs to be wrapped with square brackets since it's not providing a URI. Note: initialize with arg_check => true does not wrap IPv6 hosts. by Joe Rafaniello <jrafanie@redhat.com> https://github.com/ruby/ruby/pull/765 fix GH-765 * test/uri/test_generic.rb: Add more tests git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48666 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/uri/rfc3986_parser.rb (URI::RFC3986_Parser::RFC3986_URI):naruse2014-11-031-0/+4
| | | | | | | | allow '[' and ']' for URI input (and escape). [Bug #10402] * lib/uri/generic.rb (URI#query=): escape '[', '\', and ']'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/rfc3986_parser.rb: raise URI::InvalidURIError whenglass2014-09-271-0/+6
| | | | | | | | uri doesn't respond to #to_str. [ruby-core:64453] [Bug #10150] * test/uri/test_parser.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/rfc3986_parser.rb: specify a regexp for :OPAQUE; generic.rbnaruse2014-09-171-0/+5
| | | | | | | | assumes it is present, and will refuse all values otherwise. by Matthew Draper <matthew@trebex.net> https://github.com/ruby/ruby/pull/718 fix GH-718 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* uri/common.rb: use negative look-aheadnobu2014-08-251-0/+3
| | | | | | | | * lib/uri/common.rb (URI.decode_www_form_component): use negative look-ahead instead of nested repeat operators, to get rid of backtrack explosion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic#query=): remove validation, justnaruse2014-07-031-2/+2
| | | | | | | | | | | | | | | | escape. [Feature #2542] * lib/uri/generic.rb (URI::Generic#fragment=): ditto. * lib/uri/generic.rb (URI::Generic#check_query): removed. * lib/uri/generic.rb (URI::Generic#set_query): ditto. * lib/uri/generic.rb (URI::Generic#check_fragment): ditto. * lib/uri/generic.rb (URI::Generic#set_fragment): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/mailto.rb: update to latest specs, RFC 6068 and HTML5.naruse2014-06-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | * lib/uri/mailto.rb (HEADER_PATTERN): removed. * lib/uri/mailto.rb (HEADER_REGEXP): use RFC 6068 hfields. * lib/uri/mailto.rb (EMAIL_REGEXP): use HTML5 email regexp. * lib/uri/mailto.rb (URI::MailTo.build): support multiple to addresses. * lib/uri/mailto.rb (URI::MailTo#initialize): Support multiple to addresses. Don't check with regexp, only split. * lib/uri/mailto.rb (URI::MailTo#check_to): verify by matching URI path-rootless and HTML5 email regexp with unescaped one. * lib/uri/mailto.rb (URI::MailTo#check_headers): verify only by HEADER_REGEXP. * lib/uri/mailto.rb (URI::MailTo#set_headers): don't check by HEADER_REGEXP, only split it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress warnings: URI.regexp is obsoletenaruse2014-06-271-11/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "* lib/uri/mailto.rb: support RFC6068."naruse2014-06-241-1/+4
| | | | | | to fix mailto URI syntax git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/uri/test_common.rb: use `require_relative` for parallel test.nobu2014-06-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/mailto.rb: support RFC6068.naruse2014-06-231-4/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (check_port): allow strings for port= asnaruse2014-06-231-0/+8
| | | | | | | | described in rdoc. * lib/uri/rfc3986_parser.rb (regexp): implementation detail of above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress warnings of URI.extractnaruse2014-06-231-15/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* support RFC3986 [Feature #2542]naruse2014-06-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | * lib/uri/common.rb (URI::REGEXP): move to lib/uri/rfc2396_parser.rb. * lib/uri/common.rb (URI::Parser): ditto. * lib/uri/common.rb (URI.split): use RFC3986_Parser. * lib/uri/common.rb (URI.parse): ditto. * lib/uri/common.rb (URI.join): ditto. * lib/uri/common.rb (URI.extract): deprecated. * lib/uri/common.rb (URI.regexp): ditto. * lib/uri/rfc2396_parser.rb: added. * lib/uri/rfc3986_parser.rb: added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/uri/test_generic.rb: fix wrong arguments for test case.hsbt2014-06-161-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/uri/test_generic.rb (URI#test_merge): Test uri + URI(path)knu2013-11-211-9/+25
| | | | | | in addition to uri + path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic.find_proxy): return nil ifnaruse2013-09-131-2/+2
| | | | | | | http_proxy environment variable is empty string. [ruby-core:57140] [Bug #8898] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/common.rb (URI.decode_www_form_component):sorah2013-07-311-0/+3
| | | | | | Don't raise error when str includes multibyte characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (find_proxy): raise BadURIError if the URI isnaruse2013-07-241-0/+1
| | | | | | a relative URI. [Bug #8645] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/common.rb (URI.decode_www_form): scrub string if decodednaruse2013-05-181-0/+2
| | | | | | bytes are invalid for the encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/common.rb (URI.decode_www_form): follow current URL Standard.naruse2013-04-251-8/+46
| | | | | | | | | | | | | It gets encoding argument to specify the character encoding. It now allows loose percent encoded strings, but denies ;-separator. [ruby-core:53475] [Bug #8103] * lib/uri/common.rb (URI.decode_www_form): follow current URL Standard. It gets encoding argument to convert before percent encode. Now UTF-16 strings aren't converted to UTF-8 before percent encode by default. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/ftp.rb (URI::FTP#initialize): raise InvalidURIError if "//"naruse2012-08-301-0/+4
| | | | | | is not present [ruby-core:47344] [Bug #6945] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/uri/test_generic.rb (URI#test_find_proxy): add tests with empty ↵kazu2012-07-221-0/+8
| | | | | | *_proxy env variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix failureskazu2012-07-221-2/+9
| | | | | | | | | | * test/uri/test_generic.rb (URI#with_env): unset proxy related env variables. [Bug #6774] * test/uri/test_generic.rb (URI#test_find_proxy): fix failures when proxy related env variables already set. [Bug #6774] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http.rb: Net::HTTP now automatically detects and usesdrbrain2012-07-201-0/+49
| | | | | | | | | | | | | | | | | | | | | | proxies from the environment. A proxy may also be specified as before. Net::HTTP::Proxy still creates anonymous classes, but these classes are only used to store configuration information. When an HTTP instance is created the configuration is now copied. Additionally, Net::HTTP::ProxyDelta is no longer used by Net::HTTP [Feature #6546] * lib/open-uri.rb: Moved URI::Generic#find_proxy to uri/generic. * lib/uri/generic.rb: Imported find_proxy from open-uri. * test/open-uri/test_open-uri.rb: Moved proxy-discovery tests to URI. * test/uri/test_generic.rb: Imported proxy-discovery tests from open-uri. * test/net/http/test_http.rb: Added tests for proxy behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic.build): duplicate args before addingnaruse2012-05-181-0/+9
| | | | | | | | | | | | | | | new items. (don't change arguments) * lib/uri/generic.rb (URI::Generic.build): use URI::Generic::COMPONENT if this method is called from URI::Generic. * lib/uri/generic.rb (URI::Generic.build2): escape only if the item is a String. * lib/uri/generic.rb (URI::Generic.build2): use DEFAULT_PARSER because it doesn't have parser method. [Bug #6420] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (module URI): URI now downcases the scheme todrbrain2012-04-111-0/+6
| | | | | | | | follow RFC 2396 section 3.1. [ruby-trunk - Feature #4551] * test/uri/test_generic.rb (class URI): Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/mailto.rb (URI::MailTo.build): follow Array#to_s change ofnaruse2012-01-231-0/+10
| | | | | | Ruby 1.9; use Array#join. [Bug #5840] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/common.rb (URI::Parser#initialize_regexp):naruse2012-01-051-0/+1
| | | | | | use \A \z instead of ^ $. [Bug #5843] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http.rb (URI::HTTP#request_uri): return nil when the urinaruse2011-06-031-0/+1
| | | | | | is path-rootless form. Bug #4759 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add some more tests for the previous fix.knu2011-04-151-3/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (#route_from_path): Fix a bug whereknu2011-04-151-0/+5
| | | | | | | | | URI('http://h/b/').route_to('http://h/b') wrongly returned './' (should be '../b'). [Bug #4476] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/uri/test_common.rb (TestCommon#test_encode_www_form): addkazu2010-12-061-0/+5
| | | | | | tests for r30015. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/common.rb (URI::Parser#initialize_pattern):naruse2010-12-061-1/+1
| | | | | | refix for restrict the pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/common.rb (URI::WFKV_): get rid of backtrack explosionnobu2010-11-291-0/+2
| | | | | | by nested repeat operators. [ruby-core:33464] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic#hostname): new method.akr2010-10-061-0/+10
| | | | | | | | | | | | | | (URI::Generic#hostname=): ditto. * lib/open-uri.rb: use URI#hostname * lib/net/http.rb: ditto. [ruby-core:32056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/common.rb (URI.encode_www_form): change treatment ofnaruse2010-09-301-0/+15
| | | | | | | | undefined value in given array as latest internet draft for application/www-form-urlencoded. http://tools.ietf.org/html/draft-hoehrmann-urlencoded-01 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/common.rb (decode_www_form_component): validate.naruse2010-04-101-0/+2
| | | | | | | | | | [ruby-dev:40938] * lib/uri/common.rb (decode_www_form): allow empty string. * lib/uri/common.rb: fix nodoc for constant. [ruby-dev:40949] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e