From d285d7b19b765435a1a8b3db8dc4447f4c582afd Mon Sep 17 00:00:00 2001 From: Kirill Mokevnin Date: Fri, 6 Feb 2026 07:28:04 -0500 Subject: [PATCH] fix hal+json content type detection --- lib/amocrm/internal/util.rb | 2 +- test/amocrm/internal/util_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/amocrm/internal/util.rb b/lib/amocrm/internal/util.rb index 3756406..f1b28cb 100644 --- a/lib/amocrm/internal/util.rb +++ b/lib/amocrm/internal/util.rb @@ -485,7 +485,7 @@ def writable_enum(&blk) end # @type [Regexp] - JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)} + JSON_CONTENT = %r{^application/(?:[a-z0-9.-]+\+)?json(?!l)} # @type [Regexp] JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)} diff --git a/test/amocrm/internal/util_test.rb b/test/amocrm/internal/util_test.rb index 41a6971..cfbfbd6 100644 --- a/test/amocrm/internal/util_test.rb +++ b/test/amocrm/internal/util_test.rb @@ -171,6 +171,7 @@ def test_json_content cases = { "application/json" => true, "application/jsonl" => false, + "application/hal+json" => true, "application/vnd.github.v3+json" => true, "application/vnd.api+json" => true }