Commit graph

17 commits

Author SHA1 Message Date
Nobuyoshi Nakada
f1764623db [ruby/uri] Make URI::regexp schemes case sensitive
(https://github.com/ruby/uri/pull/38)

0c2b6468fa
2025-07-12 03:24:15 +00:00
Nobuyoshi Nakada
f5acefca44 [ruby/uri] Prefer dedicated assertion methods
d79b3f5b94
2025-07-08 10:30:30 +00:00
Hiroshi SHIBATA
68ebd56a76 [ruby/uri] Use URI::RFC2396_PARSER explicitly in URI
898b889811
2024-08-08 02:09:27 +00:00
Hiroshi SHIBATA
862041d054 [ruby/uri] Rename and switch RFC2396_PARSER test
2e0f73f05e
2024-07-19 00:50:36 +00:00
Hiroshi SHIBATA
ce4da88a57 [ruby/uri] Switch to inspect with default parser
0ab9abbf08
2024-07-19 00:50:36 +00:00
Nobuyoshi Nakada
995ce947be [ruby/uri] Fix quadratic backtracking on invalid port number
https://hackerone.com/reports/1958260

9d7bcef1e6
2023-06-29 01:07:52 +00:00
Nobuyoshi Nakada
1eff362492 [ruby/uri] Fix quadratic backtracking on invalid relative URI
https://hackerone.com/reports/1958260

9010ee2536
2023-06-29 01:07:51 +00:00
Nobuyoshi Nakada
6d734a8975 [ruby/uri] Fix RFC3986 regexps
8e38592241
2023-06-13 05:57:17 +00:00
Nobuyoshi Nakada
4b1504ae0a [ruby/uri] Fix splitting relative URI
ffbab83de6
2022-10-13 16:24:53 +09:00
Jeremy Evans
fbebfe1697 [ruby/uri] Add URI::Generic#decoded_#{user,password}
URI::Generic#{user,password} return the encoded values, which are
not that useful if you want to do authentication with them.
Automatic decoding by default would break backwards compatibility.
Optional automatic decoding via a keyword to URI.parse would
require threading the option through at least 3 other methods, and
would make semantics confusing (user= takes encoded or unencoded
password?) or require more work.  Thus, adding this as a separate
method seemed the simplest approach.

Unfortunately, URI lacks a method for correct decoding.  Unlike in
www form components, + in earlier parts of the URI such as the
userinfo section is treated verbatim and not as an encoded space.
Add URI.#{en,de}code_uri_component methods, which are almost the
same as URI.#{en,de}code_www_form_component, but without the
special SP => + handling.

Implements [Feature #9045]

16cfc4e92f
2022-05-12 14:54:37 +09:00
Jeremy Evans
3e27ca6047 [ruby/uri] Add tests for URI::RFC{2396,3986}_Parser#inspect
d47dae2f8e
2021-04-22 14:54:37 +09:00
Jeremy Evans
7909f06212 Check for invalid hex escapes in URI#query=
Fixes [Bug #11275]
2019-10-08 07:30:55 -07:00
naruse
234a30459c set UTF-8 if given URI string is ASCII
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
2018-03-22 11:20:03 +00:00
naruse
6db869c101 fix error if the input is mixed Unicode and percent-escapes
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
2018-03-08 09:38:01 +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
glass
a4645e5612 * lib/uri/rfc3986_parser.rb: raise URI::InvalidURIError when
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
2014-09-27 03:13:22 +00:00
akira
3da03397ce * lib/uri/common.rb (URI::Parser): new class.
* lib/uri/mailto.rb, lib/uri/generic.rb: follow the above change.

	* test/uri/test_parser.rb: added tests for URI::Parser.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-10 09:34:49 +00:00