summaryrefslogtreecommitdiff
path: root/lib/uri/common.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2021-07-28 12:26:31 +0200
committerBenoit Daloze <eregontp@gmail.com>2021-07-28 12:26:31 +0200
commit59a65f2d2402e0d34d9232236f152d62e74f9483 (patch)
tree2b5731c91047ffd4e4617f4023fd38fbfd02c407 /lib/uri/common.rb
parent71945ad827efe0bf62bbf87b5528206aabbd4022 (diff)
Update to latest uri
* https://github.com/ruby/uri/commit/bc47bf71df2b2e9cea09d0b2684ceac7355e42a0 * To include the fix from https://github.com/ruby/uri/pull/27
Diffstat (limited to 'lib/uri/common.rb')
-rw-r--r--lib/uri/common.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index 2bb13adf23..26b179add2 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -91,8 +91,8 @@ module URI
const_name = scheme.to_s.upcase
uri_class = INITIAL_SCHEMES[const_name]
- if !uri_class && !const_name.empty? && Schemes.const_defined?(const_name, false)
- uri_class = Schemes.const_get(const_name, false)
+ uri_class ||= if /\A[A-Z]\w*\z/.match?(const_name) && Schemes.const_defined?(const_name, false)
+ Schemes.const_get(const_name, false)
end
uri_class ||= default