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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7d290f34c964dc16393d7ccac540f560a4dd5833a4ad6b2cbdb2caeb8d75fa3
4
- data.tar.gz: d766d2717329f1b7228f30e893f528eb8ea505fff0ebace0f5c7be1bf6a519a6
3
+ metadata.gz: ed62418ed97c47a321bf9f4ea7dd00d908646d19d8cc28f77657335e82f33a8b
4
+ data.tar.gz: a90427a28cbafc1d8df8001325657f97862aeebaa8d1041d06df7e59a64072d7
5
5
  SHA512:
6
- metadata.gz: d2504a9927b38296e4a98ac694930b46ec8a61a57c941d768618e0abc8902bb247ef8b854b948fd91c8cee0d6dcd16db7cbd5944788c15b87395a0207b3b5341
7
- data.tar.gz: 76a7607632b3beeef4953ad4fd942d2bf7559df5fad5ef6952294cfb36e7da45e3744cbf32d8648f2f17825baa89440d0d3f26a0ad9dca70b526606e7564ae89
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
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "e-invoice-api", "~> 0.26.2"
29
+ gem "e-invoice-api", "~> 0.26.3"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -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 { ERB::Util.url_encode(_1) }
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 = ERB::Util.url_encode(val.filename)
593
+ filename = encode_path(val.filename)
580
594
  y << "; filename=\"#{filename}\""
581
595
  in Pathname | IO
582
- filename = ERB::Util.url_encode(::File.basename(val.to_path))
596
+ filename = encode_path(::File.basename(val.to_path))
583
597
  y << "; filename=\"#{filename}\""
584
598
  else
585
599
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EInvoiceAPI
4
- VERSION = "0.26.2"
4
+ VERSION = "0.26.3"
5
5
  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]]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: e-invoice-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.2
4
+ version: 0.26.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - e-invoice