addressable 2.8.5 → 2.8.7
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/CHANGELOG.md +54 -44
- data/Gemfile +1 -0
- data/Rakefile +0 -3
- data/addressable.gemspec +7 -7
- data/lib/addressable/template.rb +1 -1
- data/lib/addressable/uri.rb +32 -21
- data/lib/addressable/version.rb +1 -1
- data/tasks/gem.rake +4 -4
- metadata +9 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62b62e368b9dffbec4c9aaf879257067698b83daff1cc13542352da419f3f88e
|
|
4
|
+
data.tar.gz: 7f3231aecc91ef0c3087ff2325d78e9a1f4c9f05a752f2c35c8f0bb740fd5996
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 670e1aeddc5a4f62ad39040007cef7371107237b2e4064755355dfbc43cfc62a956f78358c95793a9f55cd325b7b46ce532003bdd9711b1bc3c79b35e0d3cbf6
|
|
7
|
+
data.tar.gz: d7aed8469d926b0bcdd19202593f8bfa162d9dafb38dabca632ccee8af3fd26920dfbce3f18b674d583f5aaa2e7c51717ccf46fab3a1a4fb4a8dfbd74a80da16
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
# Addressable 2.8.
|
|
1
|
+
# Addressable 2.8.7 <a name="v2.8.7">
|
|
2
|
+
- Allow `public_suffix` 6 ([#535])
|
|
3
|
+
|
|
4
|
+
[#535]: https://github.com/sporkmonger/addressable/pull/535
|
|
5
|
+
|
|
6
|
+
# Addressable 2.8.6 <a name="v2.8.6">
|
|
7
|
+
- Memoize regexps for common character classes ([#524])
|
|
8
|
+
|
|
9
|
+
[#524]: https://github.com/sporkmonger/addressable/pull/524
|
|
10
|
+
|
|
11
|
+
# Addressable 2.8.5 <a name="v2.8.5">
|
|
2
12
|
- Fix thread safety issue with encoding tables ([#515])
|
|
3
13
|
- Define URI::NONE as a module to avoid serialization issues ([#509])
|
|
4
14
|
- Fix YAML serialization ([#508])
|
|
@@ -7,18 +17,18 @@
|
|
|
7
17
|
[#509]: https://github.com/sporkmonger/addressable/pull/509
|
|
8
18
|
[#515]: https://github.com/sporkmonger/addressable/pull/515
|
|
9
19
|
|
|
10
|
-
# Addressable 2.8.4
|
|
20
|
+
# Addressable 2.8.4 <a name="v2.8.4">
|
|
11
21
|
- Restore `Addressable::IDNA.unicode_normalize_kc` as a deprecated method ([#504])
|
|
12
22
|
|
|
13
23
|
[#504]: https://github.com/sporkmonger/addressable/pull/504
|
|
14
24
|
|
|
15
|
-
# Addressable 2.8.3
|
|
25
|
+
# Addressable 2.8.3 <a name="v2.8.3">
|
|
16
26
|
- Fix template expand level 2 hash support for non-string objects ([#499], [#498])
|
|
17
27
|
|
|
18
28
|
[#499]: https://github.com/sporkmonger/addressable/pull/499
|
|
19
29
|
[#498]: https://github.com/sporkmonger/addressable/pull/498
|
|
20
30
|
|
|
21
|
-
# Addressable 2.8.2
|
|
31
|
+
# Addressable 2.8.2 <a name="v2.8.2">
|
|
22
32
|
- Improve cache hits and JIT friendliness ([#486](https://github.com/sporkmonger/addressable/pull/486))
|
|
23
33
|
- Improve code style and test coverage ([#482](https://github.com/sporkmonger/addressable/pull/482))
|
|
24
34
|
- Ensure reset of deferred validation ([#481](https://github.com/sporkmonger/addressable/pull/481))
|
|
@@ -27,7 +37,7 @@
|
|
|
27
37
|
|
|
28
38
|
[#492]: https://github.com/sporkmonger/addressable/pull/492
|
|
29
39
|
|
|
30
|
-
# Addressable 2.8.1
|
|
40
|
+
# Addressable 2.8.1 <a name="v2.8.1">
|
|
31
41
|
- refactor `Addressable::URI.normalize_path` to address linter offenses ([#430](https://github.com/sporkmonger/addressable/pull/430))
|
|
32
42
|
- update gemspec to reflect supported Ruby versions ([#466], [#464], [#463])
|
|
33
43
|
- compatibility w/ public_suffix 5.x ([#466], [#465], [#460])
|
|
@@ -43,7 +53,7 @@
|
|
|
43
53
|
[#465]: https://github.com/sporkmonger/addressable/pull/465
|
|
44
54
|
[#466]: https://github.com/sporkmonger/addressable/pull/466
|
|
45
55
|
|
|
46
|
-
# Addressable 2.8.0
|
|
56
|
+
# Addressable 2.8.0 <a name="v2.8.0">
|
|
47
57
|
- fixes ReDoS vulnerability in Addressable::Template#match
|
|
48
58
|
- no longer replaces `+` with spaces in queries for non-http(s) schemes
|
|
49
59
|
- fixed encoding ipv6 literals
|
|
@@ -55,14 +65,14 @@
|
|
|
55
65
|
- performance improvements
|
|
56
66
|
- switch CI/CD to GitHub Actions
|
|
57
67
|
|
|
58
|
-
# Addressable 2.7.0
|
|
68
|
+
# Addressable 2.7.0 <a name="v2.7.0">
|
|
59
69
|
- added `:compacted` flag to `normalized_query`
|
|
60
70
|
- `heuristic_parse` handles `mailto:` more intuitively
|
|
61
71
|
- dropped explicit support for JRuby 9.0.5.0
|
|
62
72
|
- compatibility w/ public_suffix 4.x
|
|
63
73
|
- performance improvements
|
|
64
74
|
|
|
65
|
-
# Addressable 2.6.0
|
|
75
|
+
# Addressable 2.6.0 <a name="v2.6.0">
|
|
66
76
|
- added `tld=` method to allow assignment to the public suffix
|
|
67
77
|
- most `heuristic_parse` patterns are now case-insensitive
|
|
68
78
|
- `heuristic_parse` handles more `file://` URI variations
|
|
@@ -73,17 +83,17 @@
|
|
|
73
83
|
- minor performance improvements in regexps
|
|
74
84
|
- fixes to eliminate warnings
|
|
75
85
|
|
|
76
|
-
# Addressable 2.5.2
|
|
86
|
+
# Addressable 2.5.2 <a name="v2.5.2">
|
|
77
87
|
- better support for frozen string literals
|
|
78
88
|
- fixed bug w/ uppercase characters in scheme
|
|
79
89
|
- IDNA errors w/ emoji URLs
|
|
80
90
|
- compatibility w/ public_suffix 3.x
|
|
81
91
|
|
|
82
|
-
# Addressable 2.5.1
|
|
92
|
+
# Addressable 2.5.1 <a name="v2.5.1">
|
|
83
93
|
- allow unicode normalization to be disabled for URI Template expansion
|
|
84
94
|
- removed duplicate test
|
|
85
95
|
|
|
86
|
-
# Addressable 2.5.0
|
|
96
|
+
# Addressable 2.5.0 <a name="v2.5.0">
|
|
87
97
|
- dropping support for Ruby 1.9
|
|
88
98
|
- adding support for Ruby 2.4 preview
|
|
89
99
|
- add support for public suffixes and tld; first runtime dependency
|
|
@@ -97,7 +107,7 @@
|
|
|
97
107
|
- host parts longer than 63 bytes will be ignored and not passed to libidn
|
|
98
108
|
- normalized values always encoded as UTF-8
|
|
99
109
|
|
|
100
|
-
# Addressable 2.4.0
|
|
110
|
+
# Addressable 2.4.0 <a name="v2.4.0">
|
|
101
111
|
- support for 1.8.x dropped
|
|
102
112
|
- double quotes in a host now raises an error
|
|
103
113
|
- newlines in host will no longer get unescaped during normalization
|
|
@@ -109,17 +119,17 @@
|
|
|
109
119
|
- fixed minor bug where an exception would be thrown for a missing ACE suffix
|
|
110
120
|
- better partial expansion of URI templates
|
|
111
121
|
|
|
112
|
-
# Addressable 2.3.8
|
|
122
|
+
# Addressable 2.3.8 <a name="v2.3.8">
|
|
113
123
|
- fix warnings
|
|
114
124
|
- update dependency gems
|
|
115
125
|
- support for 1.8.x officially deprecated
|
|
116
126
|
|
|
117
|
-
# Addressable 2.3.7
|
|
127
|
+
# Addressable 2.3.7 <a name="v2.3.7">
|
|
118
128
|
- fix scenario in which invalid URIs don't get an exception until inspected
|
|
119
129
|
- handle hostnames with two adjacent periods correctly
|
|
120
130
|
- upgrade of RSpec
|
|
121
131
|
|
|
122
|
-
# Addressable 2.3.6
|
|
132
|
+
# Addressable 2.3.6 <a name="v2.3.6">
|
|
123
133
|
- normalization drops empty query string
|
|
124
134
|
- better handling in template extract for missing values
|
|
125
135
|
- template modifier for `'?'` now treated as optional
|
|
@@ -128,19 +138,19 @@
|
|
|
128
138
|
- added `:sorted` option to normalization of query strings
|
|
129
139
|
- fixed issue with normalization of hosts given in `'example.com.'` form
|
|
130
140
|
|
|
131
|
-
# Addressable 2.3.5
|
|
141
|
+
# Addressable 2.3.5 <a name="v2.3.5">
|
|
132
142
|
- added Addressable::URI#empty? method
|
|
133
143
|
- Addressable::URI#hostname methods now strip square brackets from IPv6 hosts
|
|
134
144
|
- compatibility with Net::HTTP in Ruby 2.0.0
|
|
135
145
|
- Addressable::URI#route_from should always give relative URIs
|
|
136
146
|
|
|
137
|
-
# Addressable 2.3.4
|
|
147
|
+
# Addressable 2.3.4 <a name="v2.3.4">
|
|
138
148
|
- fixed issue with encoding altering its inputs
|
|
139
149
|
- query string normalization now leaves ';' characters alone
|
|
140
150
|
- FakeFS is detected before attempting to load unicode tables
|
|
141
151
|
- additional testing to ensure frozen objects don't cause problems
|
|
142
152
|
|
|
143
|
-
# Addressable 2.3.3
|
|
153
|
+
# Addressable 2.3.3 <a name="v2.3.3">
|
|
144
154
|
- fixed issue with converting common primitives during template expansion
|
|
145
155
|
- fixed port encoding issue
|
|
146
156
|
- removed a few warnings
|
|
@@ -149,59 +159,59 @@
|
|
|
149
159
|
- no template match should now result in nil instead of an empty MatchData
|
|
150
160
|
- added license information to gemspec
|
|
151
161
|
|
|
152
|
-
# Addressable 2.3.2
|
|
162
|
+
# Addressable 2.3.2 <a name="v2.3.2">
|
|
153
163
|
- added Addressable::URI#default_port method
|
|
154
164
|
- fixed issue with Marshalling Unicode data on Windows
|
|
155
165
|
- improved heuristic parsing to better handle IPv4 addresses
|
|
156
166
|
|
|
157
|
-
# Addressable 2.3.1
|
|
167
|
+
# Addressable 2.3.1 <a name="v2.3.1">
|
|
158
168
|
- fixed missing unicode data file
|
|
159
169
|
|
|
160
|
-
# Addressable 2.3.0
|
|
170
|
+
# Addressable 2.3.0 <a name="v2.3.0">
|
|
161
171
|
- updated Addressable::Template to use RFC 6570, level 4
|
|
162
172
|
- fixed compatibility problems with some versions of Ruby
|
|
163
173
|
- moved unicode tables into a data file for performance reasons
|
|
164
174
|
- removing support for multiple query value notations
|
|
165
175
|
|
|
166
|
-
# Addressable 2.2.8
|
|
176
|
+
# Addressable 2.2.8 <a name="v2.2.8">
|
|
167
177
|
- fixed issues with dot segment removal code
|
|
168
178
|
- form encoding can now handle multiple values per key
|
|
169
179
|
- updated development environment
|
|
170
180
|
|
|
171
|
-
# Addressable 2.2.7
|
|
181
|
+
# Addressable 2.2.7 <a name="v2.2.7">
|
|
172
182
|
- fixed issues related to Addressable::URI#query_values=
|
|
173
183
|
- the Addressable::URI.parse method is now polymorphic
|
|
174
184
|
|
|
175
|
-
# Addressable 2.2.6
|
|
185
|
+
# Addressable 2.2.6 <a name="v2.2.6">
|
|
176
186
|
- changed the way ambiguous paths are handled
|
|
177
187
|
- fixed bug with frozen URIs
|
|
178
188
|
- https supported in heuristic parsing
|
|
179
189
|
|
|
180
|
-
# Addressable 2.2.5
|
|
190
|
+
# Addressable 2.2.5 <a name="v2.2.5">
|
|
181
191
|
- 'parsing' a pre-parsed URI object is now a dup operation
|
|
182
192
|
- introduced conditional support for libidn
|
|
183
193
|
- fixed normalization issue on ampersands in query strings
|
|
184
194
|
- added additional tests around handling of query strings
|
|
185
195
|
|
|
186
|
-
# Addressable 2.2.4
|
|
196
|
+
# Addressable 2.2.4 <a name="v2.2.4">
|
|
187
197
|
- added origin support from draft-ietf-websec-origin-00
|
|
188
198
|
- resolved issue with attempting to navigate below root
|
|
189
199
|
- fixed bug with string splitting in query strings
|
|
190
200
|
|
|
191
|
-
# Addressable 2.2.3
|
|
201
|
+
# Addressable 2.2.3 <a name="v2.2.3">
|
|
192
202
|
- added :flat_array notation for query strings
|
|
193
203
|
|
|
194
|
-
# Addressable 2.2.2
|
|
204
|
+
# Addressable 2.2.2 <a name="v2.2.2">
|
|
195
205
|
- fixed issue with percent escaping of '+' character in query strings
|
|
196
206
|
|
|
197
|
-
# Addressable 2.2.1
|
|
207
|
+
# Addressable 2.2.1 <a name="v2.2.1">
|
|
198
208
|
- added support for application/x-www-form-urlencoded.
|
|
199
209
|
|
|
200
|
-
# Addressable 2.2.0
|
|
210
|
+
# Addressable 2.2.0 <a name="v2.2.0">
|
|
201
211
|
- added site methods
|
|
202
212
|
- improved documentation
|
|
203
213
|
|
|
204
|
-
# Addressable 2.1.2
|
|
214
|
+
# Addressable 2.1.2 <a name="v2.1.2">
|
|
205
215
|
- added HTTP request URI methods
|
|
206
216
|
- better handling of Windows file paths
|
|
207
217
|
- validation_deferred boolean replaced with defer_validation block
|
|
@@ -209,14 +219,14 @@
|
|
|
209
219
|
- fixed issue with constructing URIs with relative paths
|
|
210
220
|
- fixed warnings
|
|
211
221
|
|
|
212
|
-
# Addressable 2.1.1
|
|
222
|
+
# Addressable 2.1.1 <a name="v2.1.1">
|
|
213
223
|
- more type checking changes
|
|
214
224
|
- fixed issue with unicode normalization
|
|
215
225
|
- added method to find template defaults
|
|
216
226
|
- symbolic keys are now allowed in template mappings
|
|
217
227
|
- numeric values and symbolic values are now allowed in template mappings
|
|
218
228
|
|
|
219
|
-
# Addressable 2.1.0
|
|
229
|
+
# Addressable 2.1.0 <a name="v2.1.0">
|
|
220
230
|
- refactored URI template support out into its own class
|
|
221
231
|
- removed extract method due to being useless and unreliable
|
|
222
232
|
- removed Addressable::URI.expand_template
|
|
@@ -230,15 +240,15 @@
|
|
|
230
240
|
- worked around issue with freezing URIs
|
|
231
241
|
- improved specs
|
|
232
242
|
|
|
233
|
-
# Addressable 2.0.2
|
|
243
|
+
# Addressable 2.0.2 <a name="v2.0.2">
|
|
234
244
|
- fixed issue with URI template expansion
|
|
235
245
|
- fixed issue with percent escaping characters 0-15
|
|
236
246
|
|
|
237
|
-
# Addressable 2.0.1
|
|
247
|
+
# Addressable 2.0.1 <a name="v2.0.1">
|
|
238
248
|
- fixed issue with query string assignment
|
|
239
249
|
- fixed issue with improperly encoded components
|
|
240
250
|
|
|
241
|
-
# Addressable 2.0.0
|
|
251
|
+
# Addressable 2.0.0 <a name="v2.0.0">
|
|
242
252
|
- the initialize method now takes an options hash as its only parameter
|
|
243
253
|
- added query_values method to URI class
|
|
244
254
|
- completely replaced IDNA implementation with pure Ruby
|
|
@@ -253,20 +263,20 @@
|
|
|
253
263
|
- updated URI Template code to match v 03 of the draft spec
|
|
254
264
|
- added a bunch of new specifications
|
|
255
265
|
|
|
256
|
-
# Addressable 1.0.4
|
|
266
|
+
# Addressable 1.0.4 <a name="v1.0.4">
|
|
257
267
|
- switched to using RSpec's pending system for specs that rely on IDN
|
|
258
268
|
- fixed issue with creating URIs with paths that are not prefixed with '/'
|
|
259
269
|
|
|
260
|
-
# Addressable 1.0.3
|
|
270
|
+
# Addressable 1.0.3 <a name="v1.0.3">
|
|
261
271
|
- implemented a hash method
|
|
262
272
|
|
|
263
|
-
# Addressable 1.0.2
|
|
273
|
+
# Addressable 1.0.2 <a name="v1.0.2">
|
|
264
274
|
- fixed minor bug with the extract_mapping method
|
|
265
275
|
|
|
266
|
-
# Addressable 1.0.1
|
|
276
|
+
# Addressable 1.0.1 <a name="v1.0.1">
|
|
267
277
|
- fixed minor bug with the extract_mapping method
|
|
268
278
|
|
|
269
|
-
# Addressable 1.0.0
|
|
279
|
+
# Addressable 1.0.0 <a name="v1.0.0">
|
|
270
280
|
- heuristic parse method added
|
|
271
281
|
- parsing is slightly more strict
|
|
272
282
|
- replaced to_h with to_hash
|
|
@@ -275,16 +285,16 @@
|
|
|
275
285
|
- improved heckle rake task
|
|
276
286
|
- no surviving heckle mutations
|
|
277
287
|
|
|
278
|
-
# Addressable 0.1.2
|
|
288
|
+
# Addressable 0.1.2 <a name="v0.1.2">
|
|
279
289
|
- improved normalization
|
|
280
290
|
- fixed bug in joining algorithm
|
|
281
291
|
- updated specifications
|
|
282
292
|
|
|
283
|
-
# Addressable 0.1.1
|
|
293
|
+
# Addressable 0.1.1 <a name="v0.1.1">
|
|
284
294
|
- updated documentation
|
|
285
295
|
- added URI Template variable extraction
|
|
286
296
|
|
|
287
|
-
# Addressable 0.1.0
|
|
297
|
+
# Addressable 0.1.0 <a name="v0.1.0">
|
|
288
298
|
- initial release
|
|
289
299
|
- implementation based on RFC 3986, 3987
|
|
290
300
|
- support for IRIs via libidn
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/addressable.gemspec
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: addressable 2.8.
|
|
2
|
+
# stub: addressable 2.8.7 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "addressable".freeze
|
|
6
|
-
s.version = "2.8.
|
|
6
|
+
s.version = "2.8.7".freeze
|
|
7
7
|
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
9
|
-
s.metadata = { "changelog_uri" => "https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md" } if s.respond_to? :metadata=
|
|
9
|
+
s.metadata = { "changelog_uri" => "https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#v2.8.7" } if s.respond_to? :metadata=
|
|
10
10
|
s.require_paths = ["lib".freeze]
|
|
11
11
|
s.authors = ["Bob Aman".freeze]
|
|
12
|
-
s.date = "
|
|
12
|
+
s.date = "2024-06-21"
|
|
13
13
|
s.description = "Addressable is an alternative implementation to the URI implementation that is\npart of Ruby's standard library. It is flexible, offers heuristic parsing, and\nadditionally provides extensive support for IRIs and URI templates.\n".freeze
|
|
14
14
|
s.email = "bob@sporkmonger.com".freeze
|
|
15
15
|
s.extra_rdoc_files = ["README.md".freeze]
|
|
@@ -18,11 +18,11 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.licenses = ["Apache-2.0".freeze]
|
|
19
19
|
s.rdoc_options = ["--main".freeze, "README.md".freeze]
|
|
20
20
|
s.required_ruby_version = Gem::Requirement.new(">= 2.2".freeze)
|
|
21
|
-
s.rubygems_version = "3.
|
|
21
|
+
s.rubygems_version = "3.5.11".freeze
|
|
22
22
|
s.summary = "URI Implementation".freeze
|
|
23
23
|
|
|
24
24
|
s.specification_version = 4
|
|
25
25
|
|
|
26
|
-
s.add_runtime_dependency(%q<public_suffix>.freeze, [">= 2.0.2", "<
|
|
27
|
-
s.add_development_dependency(%q<bundler>.freeze, [">= 1.0", "< 3.0"])
|
|
26
|
+
s.add_runtime_dependency(%q<public_suffix>.freeze, [">= 2.0.2".freeze, "< 7.0".freeze])
|
|
27
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 1.0".freeze, "< 3.0".freeze])
|
|
28
28
|
end
|
data/lib/addressable/template.rb
CHANGED
|
@@ -157,7 +157,7 @@ module Addressable
|
|
|
157
157
|
# the ::MatchData#[] behavior.
|
|
158
158
|
#
|
|
159
159
|
# @param [#to_int, nil] len
|
|
160
|
-
# If provided, an array of values will be
|
|
160
|
+
# If provided, an array of values will be returned with the given
|
|
161
161
|
# parameter used as length.
|
|
162
162
|
#
|
|
163
163
|
# @return [Array, String, nil]
|
data/lib/addressable/uri.rb
CHANGED
|
@@ -50,6 +50,7 @@ module Addressable
|
|
|
50
50
|
SUB_DELIMS = "\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\="
|
|
51
51
|
RESERVED = (GEN_DELIMS + SUB_DELIMS).freeze
|
|
52
52
|
UNRESERVED = (ALPHA + DIGIT + "\\-\\.\\_\\~").freeze
|
|
53
|
+
RESERVED_AND_UNRESERVED = RESERVED + UNRESERVED
|
|
53
54
|
PCHAR = (UNRESERVED + SUB_DELIMS + "\\:\\@").freeze
|
|
54
55
|
SCHEME = (ALPHA + DIGIT + "\\-\\+\\.").freeze
|
|
55
56
|
HOST = (UNRESERVED + SUB_DELIMS + "\\[\\:\\]").freeze
|
|
@@ -68,6 +69,18 @@ module Addressable
|
|
|
68
69
|
QUERY = %r{[^a-zA-Z0-9\-\.\_\~\!\$\'\(\)\*\+\,\=\:\@\/\?%]|%(?!2B|2b)}
|
|
69
70
|
end
|
|
70
71
|
|
|
72
|
+
module CharacterClassesRegexps
|
|
73
|
+
AUTHORITY = /[^#{CharacterClasses::AUTHORITY}]/
|
|
74
|
+
FRAGMENT = /[^#{CharacterClasses::FRAGMENT}]/
|
|
75
|
+
HOST = /[^#{CharacterClasses::HOST}]/
|
|
76
|
+
PATH = /[^#{CharacterClasses::PATH}]/
|
|
77
|
+
QUERY = /[^#{CharacterClasses::QUERY}]/
|
|
78
|
+
RESERVED = /[^#{CharacterClasses::RESERVED}]/
|
|
79
|
+
RESERVED_AND_UNRESERVED = /[^#{CharacterClasses::RESERVED_AND_UNRESERVED}]/
|
|
80
|
+
SCHEME = /[^#{CharacterClasses::SCHEME}]/
|
|
81
|
+
UNRESERVED = /[^#{CharacterClasses::UNRESERVED}]/
|
|
82
|
+
end
|
|
83
|
+
|
|
71
84
|
SLASH = '/'
|
|
72
85
|
EMPTY_STR = ''
|
|
73
86
|
|
|
@@ -387,9 +400,7 @@ module Addressable
|
|
|
387
400
|
# "simple/example", Addressable::URI::CharacterClasses::UNRESERVED
|
|
388
401
|
# )
|
|
389
402
|
# => "simple%2Fexample"
|
|
390
|
-
def self.encode_component(component, character_class=
|
|
391
|
-
CharacterClasses::RESERVED + CharacterClasses::UNRESERVED,
|
|
392
|
-
upcase_encoded='')
|
|
403
|
+
def self.encode_component(component, character_class=CharacterClassesRegexps::RESERVED_AND_UNRESERVED, upcase_encoded='')
|
|
393
404
|
return nil if component.nil?
|
|
394
405
|
|
|
395
406
|
begin
|
|
@@ -539,7 +550,7 @@ module Addressable
|
|
|
539
550
|
# )
|
|
540
551
|
# => "one two%2Fthree&four"
|
|
541
552
|
def self.normalize_component(component, character_class=
|
|
542
|
-
|
|
553
|
+
CharacterClassesRegexps::RESERVED_AND_UNRESERVED,
|
|
543
554
|
leave_encoded='')
|
|
544
555
|
return nil if component.nil?
|
|
545
556
|
|
|
@@ -619,15 +630,15 @@ module Addressable
|
|
|
619
630
|
uri_object = uri.kind_of?(self) ? uri : self.parse(uri)
|
|
620
631
|
encoded_uri = Addressable::URI.new(
|
|
621
632
|
:scheme => self.encode_component(uri_object.scheme,
|
|
622
|
-
Addressable::URI::
|
|
633
|
+
Addressable::URI::CharacterClassesRegexps::SCHEME),
|
|
623
634
|
:authority => self.encode_component(uri_object.authority,
|
|
624
|
-
Addressable::URI::
|
|
635
|
+
Addressable::URI::CharacterClassesRegexps::AUTHORITY),
|
|
625
636
|
:path => self.encode_component(uri_object.path,
|
|
626
|
-
Addressable::URI::
|
|
637
|
+
Addressable::URI::CharacterClassesRegexps::PATH),
|
|
627
638
|
:query => self.encode_component(uri_object.query,
|
|
628
|
-
Addressable::URI::
|
|
639
|
+
Addressable::URI::CharacterClassesRegexps::QUERY),
|
|
629
640
|
:fragment => self.encode_component(uri_object.fragment,
|
|
630
|
-
Addressable::URI::
|
|
641
|
+
Addressable::URI::CharacterClassesRegexps::FRAGMENT)
|
|
631
642
|
)
|
|
632
643
|
if return_type == String
|
|
633
644
|
return encoded_uri.to_s
|
|
@@ -692,19 +703,19 @@ module Addressable
|
|
|
692
703
|
end
|
|
693
704
|
encoded_uri = Addressable::URI.new(
|
|
694
705
|
:scheme => self.encode_component(components[:scheme],
|
|
695
|
-
Addressable::URI::
|
|
706
|
+
Addressable::URI::CharacterClassesRegexps::SCHEME),
|
|
696
707
|
:user => self.encode_component(components[:user],
|
|
697
|
-
Addressable::URI::
|
|
708
|
+
Addressable::URI::CharacterClassesRegexps::UNRESERVED),
|
|
698
709
|
:password => self.encode_component(components[:password],
|
|
699
|
-
Addressable::URI::
|
|
710
|
+
Addressable::URI::CharacterClassesRegexps::UNRESERVED),
|
|
700
711
|
:host => components[:host],
|
|
701
712
|
:port => components[:port],
|
|
702
713
|
:path => self.encode_component(components[:path],
|
|
703
|
-
Addressable::URI::
|
|
714
|
+
Addressable::URI::CharacterClassesRegexps::PATH),
|
|
704
715
|
:query => self.encode_component(components[:query],
|
|
705
|
-
Addressable::URI::
|
|
716
|
+
Addressable::URI::CharacterClassesRegexps::QUERY),
|
|
706
717
|
:fragment => self.encode_component(components[:fragment],
|
|
707
|
-
Addressable::URI::
|
|
718
|
+
Addressable::URI::CharacterClassesRegexps::FRAGMENT)
|
|
708
719
|
)
|
|
709
720
|
if return_type == String
|
|
710
721
|
return encoded_uri.to_s
|
|
@@ -755,11 +766,11 @@ module Addressable
|
|
|
755
766
|
[
|
|
756
767
|
self.encode_component(
|
|
757
768
|
key.gsub(/(\r\n|\n|\r)/, "\r\n"),
|
|
758
|
-
|
|
769
|
+
CharacterClassesRegexps::UNRESERVED
|
|
759
770
|
).gsub("%20", "+"),
|
|
760
771
|
self.encode_component(
|
|
761
772
|
value.gsub(/(\r\n|\n|\r)/, "\r\n"),
|
|
762
|
-
|
|
773
|
+
CharacterClassesRegexps::UNRESERVED
|
|
763
774
|
).gsub("%20", "+")
|
|
764
775
|
]
|
|
765
776
|
end
|
|
@@ -1528,7 +1539,7 @@ module Addressable
|
|
|
1528
1539
|
# Relative paths with colons in the first segment are ambiguous.
|
|
1529
1540
|
path = path.sub(":", "%2F")
|
|
1530
1541
|
end
|
|
1531
|
-
# String#split(
|
|
1542
|
+
# String#split(delimiter, -1) uses the more strict splitting behavior
|
|
1532
1543
|
# found by default in Python.
|
|
1533
1544
|
result = path.strip.split(SLASH, -1).map do |segment|
|
|
1534
1545
|
Addressable::URI.normalize_component(
|
|
@@ -1734,20 +1745,20 @@ module Addressable
|
|
|
1734
1745
|
buffer = "".dup
|
|
1735
1746
|
new_query_values.each do |key, value|
|
|
1736
1747
|
encoded_key = URI.encode_component(
|
|
1737
|
-
key,
|
|
1748
|
+
key, CharacterClassesRegexps::UNRESERVED
|
|
1738
1749
|
)
|
|
1739
1750
|
if value == nil
|
|
1740
1751
|
buffer << "#{encoded_key}&"
|
|
1741
1752
|
elsif value.kind_of?(Array)
|
|
1742
1753
|
value.each do |sub_value|
|
|
1743
1754
|
encoded_value = URI.encode_component(
|
|
1744
|
-
sub_value,
|
|
1755
|
+
sub_value, CharacterClassesRegexps::UNRESERVED
|
|
1745
1756
|
)
|
|
1746
1757
|
buffer << "#{encoded_key}=#{encoded_value}&"
|
|
1747
1758
|
end
|
|
1748
1759
|
else
|
|
1749
1760
|
encoded_value = URI.encode_component(
|
|
1750
|
-
value,
|
|
1761
|
+
value, CharacterClassesRegexps::UNRESERVED
|
|
1751
1762
|
)
|
|
1752
1763
|
buffer << "#{encoded_key}=#{encoded_value}&"
|
|
1753
1764
|
end
|
data/lib/addressable/version.rb
CHANGED
data/tasks/gem.rake
CHANGED
|
@@ -21,7 +21,7 @@ namespace :gem do
|
|
|
21
21
|
|
|
22
22
|
s.required_ruby_version = ">= 2.2"
|
|
23
23
|
|
|
24
|
-
s.add_runtime_dependency "public_suffix", ">= 2.0.2", "<
|
|
24
|
+
s.add_runtime_dependency "public_suffix", ">= 2.0.2", "< 7.0"
|
|
25
25
|
s.add_development_dependency "bundler", ">= 1.0", "< 3.0"
|
|
26
26
|
|
|
27
27
|
s.require_path = "lib"
|
|
@@ -31,7 +31,7 @@ namespace :gem do
|
|
|
31
31
|
s.homepage = "https://github.com/sporkmonger/addressable"
|
|
32
32
|
s.license = "Apache-2.0"
|
|
33
33
|
s.metadata = {
|
|
34
|
-
"changelog_uri" => "https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md"
|
|
34
|
+
"changelog_uri" => "https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#v#{PKG_VERSION}"
|
|
35
35
|
}
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -56,7 +56,7 @@ namespace :gem do
|
|
|
56
56
|
|
|
57
57
|
desc "Install the gem"
|
|
58
58
|
task :install => ["clobber", "gem:package"] do
|
|
59
|
-
sh "
|
|
59
|
+
sh "gem install --local ./pkg/#{GEM_SPEC.full_name}.gem"
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
desc "Uninstall the gem"
|
|
@@ -65,7 +65,7 @@ namespace :gem do
|
|
|
65
65
|
if installed_list &&
|
|
66
66
|
(installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION))
|
|
67
67
|
sh(
|
|
68
|
-
"
|
|
68
|
+
"gem uninstall --version '#{PKG_VERSION}' " +
|
|
69
69
|
"--ignore-dependencies --executables #{PKG_NAME}"
|
|
70
70
|
)
|
|
71
71
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: addressable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.
|
|
4
|
+
version: 2.8.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bob Aman
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-06-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: public_suffix
|
|
@@ -19,7 +19,7 @@ dependencies:
|
|
|
19
19
|
version: 2.0.2
|
|
20
20
|
- - "<"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '
|
|
22
|
+
version: '7.0'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -29,7 +29,7 @@ dependencies:
|
|
|
29
29
|
version: 2.0.2
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '7.0'
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: bundler
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -91,8 +91,8 @@ homepage: https://github.com/sporkmonger/addressable
|
|
|
91
91
|
licenses:
|
|
92
92
|
- Apache-2.0
|
|
93
93
|
metadata:
|
|
94
|
-
changelog_uri: https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md
|
|
95
|
-
post_install_message:
|
|
94
|
+
changelog_uri: https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md#v2.8.7
|
|
95
|
+
post_install_message:
|
|
96
96
|
rdoc_options:
|
|
97
97
|
- "--main"
|
|
98
98
|
- README.md
|
|
@@ -109,8 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
111
|
requirements: []
|
|
112
|
-
rubygems_version: 3.
|
|
113
|
-
signing_key:
|
|
112
|
+
rubygems_version: 3.5.11
|
|
113
|
+
signing_key:
|
|
114
114
|
specification_version: 4
|
|
115
115
|
summary: URI Implementation
|
|
116
116
|
test_files: []
|