uri-whatwg_parser 0.3.1 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 340c89cc9b0c80699547d7daa0a33c3c081250ebee1dd1178a36ee288a484a22
4
- data.tar.gz: 961034f93393490c76ad015aea1524b27b5955ef38112892d50b2a1e15a3ac50
3
+ metadata.gz: 429ffad8e497da64d3099494ddf9c5c3165a318f12cefab8479558b4e99eedb1
4
+ data.tar.gz: 2b507165b0f8662ce33e8f76e4680889d703d720cf10ee4d7037c44d956bb99c
5
5
  SHA512:
6
- metadata.gz: 987525847dbe6f04d4a2a4c3c8e338d57ebd964d4312528bc16e5e515ba7460922c3fedf08a4151227dbd1fbca11be4af38db6db53e1d741992460fd89c86bd0
7
- data.tar.gz: 12eae3fe44a8136aa66a55d1aa7e12b172980ae96470f890e34e721fae4c1f3f23155ff1a2e1db305ce2f239cdf239a7db43fe5feb153eb11f3f230c09fd77a4
6
+ metadata.gz: 2fe207e948cb2efaa556cb71b43a31c1bef4ee74c6fd55b22f90744cb459a619423d799b149b0f1c6fc9074d092088824294e50c1311400b2094afe545d0caa2
7
+ data.tar.gz: 132dfce557f8233213b2d2747f0d82da42a301a0bd42b9491a2224261a1ef2d26bf441114222dc009a36ae08655edaea7d916173e6ba286cfd12c9265dfbfb6a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.2
2
+
3
+ * Fix domain-to-ASCII process on host parsing to follow the latest spec
4
+
1
5
  ## 0.3.1
2
6
 
3
7
  * Fix a bug of parsing Windows drive letter
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # URI::WhatwgParser
2
2
  Ruby implementation of the [WHATWG URL Living Standard](https://url.spec.whatwg.org/).
3
3
 
4
- The latest revision that this package implements of the standard is [14 April 2026](https://url.spec.whatwg.org/commit-snapshots/b11d73b8caefe90403afe19210db05acba897722/)
4
+ The latest revision that this package implements of the standard is [26 June 2026](https://url.spec.whatwg.org/commit-snapshots/3c83874ae1eac84ceb71d8c4344673251c982bbe/)
5
5
 
6
6
  ## Installation
7
7
 
@@ -259,7 +259,13 @@ class URI::WhatwgParser
259
259
  return domain
260
260
  end
261
261
 
262
- ascii_domain = URI::IDNA.whatwg_to_ascii(domain.force_encoding(Encoding::UTF_8), be_strict: false)
262
+ begin
263
+ ascii_domain = URI::IDNA.whatwg_to_ascii(domain.force_encoding(Encoding::UTF_8), be_strict: false)
264
+ rescue URI::IDNA::Error, Encoding::CompatibilityError, ArgumentError
265
+ raise ParseError, "invalid host value" unless domain.ascii_only?
266
+
267
+ ascii_domain = domain.downcase
268
+ end
263
269
 
264
270
  raise ParseError, "including invalid value in host" if include_forbidden_domain_code_point?(ascii_domain)
265
271
  raise ParseError, "host can't be empty" if ascii_domain.empty?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module URI
4
4
  class WhatwgParser
5
- VERSION = "0.3.1"
5
+ VERSION = "0.3.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uri-whatwg_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Yaginuma