uri 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/uri/common.rb +1 -1
- data/lib/uri/generic.rb +15 -3
- data/lib/uri/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f729b13be0d81e7cc63f883ca7894af59511cd48edda7f8c0660d4eb33392d5d
|
|
4
|
+
data.tar.gz: b167fc47d98e7ab0f33936a659b9a3c8ab2fe347284c5b16666ba3220e57dcc6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3013310fc66ca0535bc1f33171e11085f030884c9519405b63911bb6bddeb12c421c9aefcb34883fd26b76fe3b0672099c14de382ac88b6fdf97b8415eb851f2
|
|
7
|
+
data.tar.gz: acc131da190534e84b45aa10765628522416f3d90efc7fa60d58a1ea13c5567a5bd81c7e0e5abbda21d5e67646d194bccd38037bad2ed5f15e17fe202676028b
|
data/lib/uri/common.rb
CHANGED
data/lib/uri/generic.rb
CHANGED
|
@@ -466,7 +466,7 @@ module URI
|
|
|
466
466
|
#
|
|
467
467
|
# uri = URI.parse("http://john:S3nsit1ve@my.example.com")
|
|
468
468
|
# uri.user = "sam"
|
|
469
|
-
# uri.to_s #=> "http://sam
|
|
469
|
+
# uri.to_s #=> "http://sam@my.example.com"
|
|
470
470
|
#
|
|
471
471
|
def user=(user)
|
|
472
472
|
check_user(user)
|
|
@@ -1021,9 +1021,21 @@ module URI
|
|
|
1021
1021
|
|
|
1022
1022
|
# RFC2396, Section 5.2, 6), a)
|
|
1023
1023
|
base_path << '' if base_path.last == '..'
|
|
1024
|
-
|
|
1025
|
-
|
|
1024
|
+
# Remove "<segment>/.." pairs in a single left-to-right pass (O(n)).
|
|
1025
|
+
# This deliberately differs from the relative-path stack handling
|
|
1026
|
+
# below: a leading ".." (one with no preceding segment left to
|
|
1027
|
+
# cancel) discards the whole base path, reproducing the previous
|
|
1028
|
+
# index/slice! implementation exactly.
|
|
1029
|
+
reduced = []
|
|
1030
|
+
base_path.each do |seg|
|
|
1031
|
+
if seg == '..'
|
|
1032
|
+
break if reduced.empty?
|
|
1033
|
+
reduced.pop
|
|
1034
|
+
else
|
|
1035
|
+
reduced << seg
|
|
1036
|
+
end
|
|
1026
1037
|
end
|
|
1038
|
+
base_path = reduced
|
|
1027
1039
|
|
|
1028
1040
|
if (first = rel_path.first) and first.empty?
|
|
1029
1041
|
base_path.clear
|
data/lib/uri/version.rb
CHANGED