protocol-url 0.8.0 → 0.10.0

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: 0e251b8fa72bc3017a56cfa385bf2bc7b9e1e4ef8add2bcd12fb8321cc349c75
4
- data.tar.gz: 700835c1db54aead624eb89003c7daa42d9ad992f7139c336e2a5293291db619
3
+ metadata.gz: 7aeaada96a9b666006635d0589aefee1a0bbd4b0df7787a40a6c5d40faeb87f1
4
+ data.tar.gz: 3bb9157f29504fd386b9da7730ad0e346371488a2cd440525ab501a5127d62e4
5
5
  SHA512:
6
- metadata.gz: 6285b5b91ba997d2f822fcc4ffd49b96dffcc1336483bd043f42a736dfb3bbe4e145e492044a201de1c8f0f3e363ae816d64af79e0412b2ce4715ec69e3b4d9c
7
- data.tar.gz: 6e4c0817905afb9b17e8e0eceae42e7ea24d6c0af6a57773d7395355b2e7b597d043c9d7795ddf62194790f0a3f53f6346d7950598721c4b079e7a419e95f793
6
+ metadata.gz: 82707be363eedcc58a739f62acdca6b5b611f8a5e7e36992a2db6b48fdc2c950d7f0b72ebb38bd05cecee8fbeb42453cdb49a6be2a921053169a0bf633a998a7
7
+ data.tar.gz: 808c99891a07593694ce6ab7542986ef7c95d53d4882c4efef79aec34fb35812824e4c69b7ce11e9fe44fa971f0ee8765408f2997db7e4f9fca25d497f314ece
checksums.yaml.gz.sig CHANGED
Binary file
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2026, by Samuel Williams.
5
+
6
+ module Protocol
7
+ module URL
8
+ # Raised when URL processing exceeds a configured limit.
9
+ class LimitError < StandardError
10
+ end
11
+ end
12
+ end
@@ -4,6 +4,7 @@
4
4
  # Copyright, 2026, by Samuel Williams.
5
5
 
6
6
  require_relative "../encoding"
7
+ require_relative "../error"
7
8
 
8
9
  module Protocol
9
10
  module URL
@@ -32,7 +33,7 @@ module Protocol
32
33
  end
33
34
 
34
35
  if @depth_limit and keys.size > @depth_limit
35
- raise RangeError, "Form data depth exceeded limit of #{@depth_limit}!"
36
+ raise LimitError, "Form data depth exceeded limit of #{@depth_limit}!"
36
37
  end
37
38
 
38
39
  Encoding.assign(keys, value, @root)
@@ -4,6 +4,7 @@
4
4
  # Copyright, 2026, by Samuel Williams.
5
5
 
6
6
  require_relative "nested"
7
+ require_relative "../error"
7
8
 
8
9
  module Protocol
9
10
  module URL
@@ -11,7 +12,7 @@ module Protocol
11
12
  module FormData
12
13
  # Incrementally parses `application/x-www-form-urlencoded` form data.
13
14
  class Parser
14
- CONTENT_TYPE = "application/x-www-form-urlencoded"
15
+ MEDIA_TYPE = "application/x-www-form-urlencoded"
15
16
 
16
17
  # The encoded body size limit.
17
18
  SIZE_LIMIT = 2 * 1024 * 1024
@@ -107,7 +108,7 @@ module Protocol
107
108
 
108
109
  def check_limit(name, value, limit)
109
110
  if limit and value > limit
110
- raise RangeError, "Form data #{name} exceeded limit of #{limit}!"
111
+ raise LimitError, "Form data #{name} exceeded limit of #{limit}!"
111
112
  end
112
113
  end
113
114
  end
@@ -7,6 +7,6 @@
7
7
  module Protocol
8
8
  # @namespace
9
9
  module URL
10
- VERSION = "0.8.0"
10
+ VERSION = "0.10.0"
11
11
  end
12
12
  end
data/lib/protocol/url.rb CHANGED
@@ -4,6 +4,7 @@
4
4
  # Copyright, 2025, by Samuel Williams.
5
5
 
6
6
  require_relative "url/version"
7
+ require_relative "url/error"
7
8
  require_relative "url/pattern"
8
9
  require_relative "url/encoding"
9
10
  require_relative "url/form_data/nested"
data/readme.md CHANGED
@@ -34,6 +34,14 @@ This project is best served by a collaborative and respectful environment. Treat
34
34
 
35
35
  Please see the [project releases](https://socketry.github.io/protocol-url/releases/index) for all releases.
36
36
 
37
+ ### v0.10.0
38
+
39
+ - Rename `Protocol::URL::FormData::Parser::CONTENT_TYPE` to `MEDIA_TYPE`.
40
+
41
+ ### v0.9.0
42
+
43
+ - Add `Protocol::URL::LimitError` for configured processing limits.
44
+
37
45
  ### v0.8.0
38
46
 
39
47
  - Use consistent limit naming for form data parser constraints.
data/releases.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Releases
2
2
 
3
+ ## v0.10.0
4
+
5
+ - Rename `Protocol::URL::FormData::Parser::CONTENT_TYPE` to `MEDIA_TYPE`.
6
+
7
+ ## v0.9.0
8
+
9
+ - Add `Protocol::URL::LimitError` for configured processing limits.
10
+
3
11
  ## v0.8.0
4
12
 
5
13
  - Use consistent limit naming for form data parser constraints.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-url
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -45,6 +45,7 @@ files:
45
45
  - lib/protocol/url.rb
46
46
  - lib/protocol/url/absolute.rb
47
47
  - lib/protocol/url/encoding.rb
48
+ - lib/protocol/url/error.rb
48
49
  - lib/protocol/url/form_data/nested.rb
49
50
  - lib/protocol/url/form_data/parser.rb
50
51
  - lib/protocol/url/path.rb
metadata.gz.sig CHANGED
Binary file