From 57f5fbd2d7f24ca09f81519c2aaca5500423622b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Jun 2026 02:02:16 +0000 Subject: [PATCH 1/2] fix(client): send content-type header for requests with an omitted optional body --- lib/moderation_api/internal/transport/base_client.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/moderation_api/internal/transport/base_client.rb b/lib/moderation_api/internal/transport/base_client.rb index 0dc56d9..772fa2d 100644 --- a/lib/moderation_api/internal/transport/base_client.rb +++ b/lib/moderation_api/internal/transport/base_client.rb @@ -306,7 +306,10 @@ def initialize( ModerationAPI::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end - headers.delete("content-type") if body.nil? + # Generated methods always pass `req[:body]` for operations that define a + # request body, so only elide the content-type header when the operation + # has no body at all, not when an optional body param was omitted. + headers.delete("content-type") if body.nil? && !req.key?(:body) url = ModerationAPI::Internal::Util.join_parsed_uri( @base_url_components, From d25e3f65b492bafdc19c2bd2a3a79143f13b0596 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Jun 2026 02:02:39 +0000 Subject: [PATCH 2/2] release: 2.22.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/moderation_api/version.rb | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c4563a8..d1a01fd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.22.0" + ".": "2.22.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6efa2f8..4e3ddaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.22.1 (2026-06-17) + +Full Changelog: [v2.22.0...v2.22.1](https://github.com/moderation-api/sdk-ruby/compare/v2.22.0...v2.22.1) + +### Bug Fixes + +* **client:** send content-type header for requests with an omitted optional body ([57f5fbd](https://github.com/moderation-api/sdk-ruby/commit/57f5fbd2d7f24ca09f81519c2aaca5500423622b)) + ## 2.22.0 (2026-06-02) Full Changelog: [v2.21.0...v2.22.0](https://github.com/moderation-api/sdk-ruby/compare/v2.21.0...v2.22.0) diff --git a/Gemfile.lock b/Gemfile.lock index 5e8dc88..3fe4301 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - moderation_api (2.22.0) + moderation_api (2.22.1) cgi connection_pool diff --git a/README.md b/README.md index b5e672a..c46a231 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "moderation_api", "~> 2.22.0" +gem "moderation_api", "~> 2.22.1" ``` diff --git a/lib/moderation_api/version.rb b/lib/moderation_api/version.rb index 865d912..fad1792 100644 --- a/lib/moderation_api/version.rb +++ b/lib/moderation_api/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ModerationAPI - VERSION = "2.22.0" + VERSION = "2.22.1" end