aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
Commit message (Collapse)AuthorAgeFilesLines
* Fakes IPSocket.getaddress in the whole methodNobuyoshi Nakada2020-05-061-24/+25
| | | | | To get rid of calling `getaddrinfo`, which may keep FDs internally.
* [ruby/uri] Check if DN existsNobuyoshi Nakada2020-05-051-0/+4
| | | | | | https://bugs.ruby-lang.org/issues/16830 https://github.com/ruby/uri/commit/b4bf8c1217
* Added implictily require for URI::HTTPHiroshi SHIBATA2020-03-261-0/+1
|
* [ruby/uri] Add support for WebSocketsMatt Muller2020-03-261-0/+70
| | | | https://github.com/ruby/uri/commit/805a95786a
* Check for invalid hex escapes in URI#query=Jeremy Evans2019-10-081-0/+5
| | | | Fixes [Bug #11275]
* Fix fallback in URI.encode_www_form_component to include #Jeremy Evans2019-09-271-0/+2
| | | | | | Patch from Matthew Kerwin. Fixes [Bug #14358]
* Make portable for standalone test-unit gem.Hiroshi SHIBATA2019-08-192-1/+3
| | | | | * It can invoke test-unit with envutil.rb * refute_match of test-unit couldn't handle String instance.
* http_proxy setting should respect both parent domain and subdomainnaruse2018-05-171-1/+7
| | | | | | | | | | | | | | | | | | | URI::Generic: Respect no_proxy for both parent domain and subdomains It is now possible to add just the subdomains for proxy bypass. In a setting where the main domain needs to go through proxy while the subdomains don't, it is now possible to just add the subdomains to the no_proxy list. The assumption that subdomains and the parent domain should behave the same wrt no_proxy has been removed. eg: Adding .example.com in no_proxy would allow example.com to go through the proxy. From: Harsimran Singh Maan <maan.harry@gmail.com> fix https://github.com/ruby/ruby/pull/1748 [Bug #14345] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* set UTF-8 if given URI string is ASCIInaruse2018-03-221-0/+1
| | | | | | | | Now URI is normally UTF-8, and US-ASCII URI string is considered as escaped a UTF-8 string. https://github.com/rails/rails/issues/32294 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Docs and tests on URI.hierarchical?, URI.absolute?nobu2018-03-211-0/+18
| | | | | | | | | | | Improve code coverage and clarify meaning of hierarchical based on RFC text. [Fix GH-1846] From: Xavier Riley <xavriley@hotmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce URI::File to handle file URI schemenaruse2018-03-151-0/+67
| | | | | | | | | | | * the default value of URI::File's authority is "" (localhost). Both nil and "localhost" is normalized to "" by default. * URI::File ignores setting userinfo and port [Feature #14035] fix https://github.com/ruby/ruby/pull/1719 fic https://github.com/ruby/ruby/pull/1832 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix error if the input is mixed Unicode and percent-escapesnaruse2018-03-081-0/+7
| | | | | | | | Reported by kivikakk (Ashe Connor) with tests and doc fix Patch based on mame and fix by naruse [Bug #14586] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Allow empty path components in a URI [Bug #8352]knu2017-12-141-0/+6
| | | | | | | | | | | * generic.rb (URI::Generic#merge, URI::Generic#route_to): Fix a bug where a sequence of slashes in the path part gets collapsed to a single slash. According to the relevant RFCs and WHATWG URL Standard, empty path components are simply valid and there is no special treatment defined for them, so we just keep them as they are. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Append "//" if empty host for file or postgres URInaruse2017-12-011-0/+4
| | | | | | | | | https://url.spec.whatwg.org/#url-serializing > Otherwise, if url’s host is null and url’s scheme is "file", append "//" to output. URL spec doesn't says anything about postgres, but assume the same thing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* URI::Generic: Separate no_proxy handlingnaruse2017-09-281-0/+17
| | | | | | To share with Net::HTTP. see #11195 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* uri/generic.rb: fix exception on non-IP formatnobu2017-01-171-0/+25
| | | | | | | * lib/uri/generic.rb (URI::Generic#find_proxy): match IP address no_proxy against resolved self IP address. [Fix GH-1513] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_mailto.rb: overwritten methodsnobu2016-12-171-6/+4
| | | | | | | * test/uri/test_mailto.rb (URI::TestMailTo#test_to_mailtext): merge overwritten methods. [Bug #10774] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_mailto.rb: adjust scopenobu2016-12-171-10/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use URI.decode_www_form_component [Bug #10774]naruse2016-12-121-0/+6
| | | | | | | `parser` refered RFC2396_Parser, but it is separated. test is contributed by Dominik Menke git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix warning: assigned but unused variablekazu2016-10-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* do not need to downcase twicekazu2016-10-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Test URI.find_proxy using env argument.akr2016-10-111-41/+111
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/http.rb: Documentation and code style imrovements.hsbt2016-09-301-0/+5
| | | | | | | * test/uri/test_http.rb: Added test for coverage. [fix GH-1427][ruby-core:77255][Misc #12756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Don't include bad password in URI exception outputtenderlove2016-09-151-0/+9
| | | | | | | | We shouldn't include the bad password in the URI exception output message. Just knowing that there is a bad password is enough information. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/mailto.rb: Removed needless `return` and use `.`` instead of `::`hsbt2016-09-121-0/+51
| | | | | | | with class method. * test/uri/test_mailto.rb: Added tests for coverage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaquenaruse2016-07-021-4/+6
| | | | | | | | only if the URI has path-rootless, not path-empty. [ruby-core:76055] [Bug #12498] patched by Chris Heisterkamp <cheister@squareup.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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