e-invoice-api 0.26.2 → 0.26.3
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 +8 -0
- data/README.md +1 -1
- data/lib/e_invoice_api/internal/util.rb +17 -3
- data/lib/e_invoice_api/version.rb +1 -1
- data/rbi/e_invoice_api/internal/util.rbi +8 -0
- data/sig/e_invoice_api/internal/util.rbs +4 -0
- 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: ed62418ed97c47a321bf9f4ea7dd00d908646d19d8cc28f77657335e82f33a8b
|
|
4
|
+
data.tar.gz: a90427a28cbafc1d8df8001325657f97862aeebaa8d1041d06df7e59a64072d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a7eabdb33dec0e12ba0dcfca8d505c41696d3914043e4e86a74fdebd4fcf82779a5c35e6f45e5cc0c0281d1116e45f9f8478322e6b9fcfb6801ad0ce1e9eaa43
|
|
7
|
+
data.tar.gz: 2d9bd76ecdaf1e86c10b4c399e4520ff405098b0c7ad7dcf2dc3125757b5f0fcdcda361a138f2518720b25955ae32a82651d7baa4df7aabd9edd8763aac8a68d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.26.3 (2026-04-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.26.2...v0.26.3](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.26.2...v0.26.3)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* align path encoding with RFC 3986 section 3.3 ([8e0aa33](https://github.com/e-invoice-be/e-invoice-rb/commit/8e0aa333af64b16c5c5de9092f810696beda0bd4))
|
|
10
|
+
|
|
3
11
|
## 0.26.2 (2026-04-01)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.26.1...v0.26.2](https://github.com/e-invoice-be/e-invoice-rb/compare/v0.26.1...v0.26.2)
|
data/README.md
CHANGED
|
@@ -237,6 +237,11 @@ module EInvoiceAPI
|
|
|
237
237
|
end
|
|
238
238
|
end
|
|
239
239
|
|
|
240
|
+
# @type [Regexp]
|
|
241
|
+
#
|
|
242
|
+
# https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
|
|
243
|
+
RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
|
|
244
|
+
|
|
240
245
|
class << self
|
|
241
246
|
# @api private
|
|
242
247
|
#
|
|
@@ -247,6 +252,15 @@ module EInvoiceAPI
|
|
|
247
252
|
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
|
|
248
253
|
end
|
|
249
254
|
|
|
255
|
+
# @api private
|
|
256
|
+
#
|
|
257
|
+
# @param path [String, Integer]
|
|
258
|
+
#
|
|
259
|
+
# @return [String]
|
|
260
|
+
def encode_path(path)
|
|
261
|
+
path.to_s.gsub(EInvoiceAPI::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
|
|
262
|
+
end
|
|
263
|
+
|
|
250
264
|
# @api private
|
|
251
265
|
#
|
|
252
266
|
# @param path [String, Array<String>]
|
|
@@ -259,7 +273,7 @@ module EInvoiceAPI
|
|
|
259
273
|
in []
|
|
260
274
|
""
|
|
261
275
|
in [String => p, *interpolations]
|
|
262
|
-
encoded = interpolations.map {
|
|
276
|
+
encoded = interpolations.map { encode_path(_1) }
|
|
263
277
|
format(p, *encoded)
|
|
264
278
|
end
|
|
265
279
|
end
|
|
@@ -576,10 +590,10 @@ module EInvoiceAPI
|
|
|
576
590
|
|
|
577
591
|
case val
|
|
578
592
|
in EInvoiceAPI::FilePart unless val.filename.nil?
|
|
579
|
-
filename =
|
|
593
|
+
filename = encode_path(val.filename)
|
|
580
594
|
y << "; filename=\"#{filename}\""
|
|
581
595
|
in Pathname | IO
|
|
582
|
-
filename =
|
|
596
|
+
filename = encode_path(::File.basename(val.to_path))
|
|
583
597
|
y << "; filename=\"#{filename}\""
|
|
584
598
|
else
|
|
585
599
|
end
|
|
@@ -148,12 +148,20 @@ module EInvoiceAPI
|
|
|
148
148
|
end
|
|
149
149
|
end
|
|
150
150
|
|
|
151
|
+
# https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
|
|
152
|
+
RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp)
|
|
153
|
+
|
|
151
154
|
class << self
|
|
152
155
|
# @api private
|
|
153
156
|
sig { params(uri: URI::Generic).returns(String) }
|
|
154
157
|
def uri_origin(uri)
|
|
155
158
|
end
|
|
156
159
|
|
|
160
|
+
# @api private
|
|
161
|
+
sig { params(path: T.any(String, Integer)).returns(String) }
|
|
162
|
+
def encode_path(path)
|
|
163
|
+
end
|
|
164
|
+
|
|
157
165
|
# @api private
|
|
158
166
|
sig { params(path: T.any(String, T::Array[String])).returns(String) }
|
|
159
167
|
def interpolate_path(path)
|
|
@@ -45,8 +45,12 @@ module EInvoiceAPI
|
|
|
45
45
|
-> top?
|
|
46
46
|
} -> top?
|
|
47
47
|
|
|
48
|
+
RFC_3986_NOT_PCHARS: Regexp
|
|
49
|
+
|
|
48
50
|
def self?.uri_origin: (URI::Generic uri) -> String
|
|
49
51
|
|
|
52
|
+
def self?.encode_path: (String | Integer path) -> String
|
|
53
|
+
|
|
50
54
|
def self?.interpolate_path: (String | ::Array[String] path) -> String
|
|
51
55
|
|
|
52
56
|
def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]]
|