summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/uri/generic.rb2
-rw-r--r--lib/uri/rfc3986_parser.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index b924f53cd7..7fbe5ff396 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -683,7 +683,7 @@ module URI
"can not set port with registry or opaque"
elsif !v.kind_of?(Fixnum) && parser.regexp[:PORT] !~ v
raise InvalidComponentError,
- "bad component(expected port component): #{v}"
+ "bad component(expected port component): #{v.inspect}"
end
return true
diff --git a/lib/uri/rfc3986_parser.rb b/lib/uri/rfc3986_parser.rb
index cd95ab8860..aa74e11eb4 100644
--- a/lib/uri/rfc3986_parser.rb
+++ b/lib/uri/rfc3986_parser.rb
@@ -84,7 +84,7 @@ module URI
QUERY: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~]|[\/?])*\z/,
FRAGMENT: /\A(?:%\h\h|[!$&-.0-;=@-Z_a-z~]|[\/?])*\z/,
OPAQUE: nil,
- PORT: nil,
+ PORT: /\A[\x09\x0a\x0c\x0d ]*\d*[\x09\x0a\x0c\x0d ]*\z/,
}
end