diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8613d52..12eafdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ jobs: github.repository == 'stainless-sdks/amocrm-ruby' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- @@ -39,7 +39,7 @@ jobs: github.repository == 'stainless-sdks/amocrm-ruby' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -60,9 +60,9 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- @@ -76,9 +76,9 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/amocrm-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index e51f89c..daf1109 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: bundler-cache: false - run: |- diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 85bfcab..14ade99 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'Hexlet/amocrm-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4208b5c..ac03171 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.0" + ".": "0.6.1" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index ace74e6..9ffffc8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 140 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hexlet/amocrm-800f4ed7083bc38fd4ddc3fdb0b975c2ad3f95b7e0375ff64d31690a3a0d5d34.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hexlet/amocrm-2bc3f4fe926ad7cebaea4425dad9ad5f79045bc4a659363c87ae43e3095f702d.yml openapi_spec_hash: ee149ec82a8a54b8ba43f99fa8a53004 config_hash: e17200f7c5d0bdc4e3739a97df48b802 diff --git a/CHANGELOG.md b/CHANGELOG.md index e3110c9..b7db8c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.6.1 (2026-05-14) + +Full Changelog: [v0.6.0...v0.6.1](https://github.com/Hexlet/amocrm-ruby/compare/v0.6.0...v0.6.1) + +### Bug Fixes + +* **client:** elide content type header on requests without body ([c5d17f3](https://github.com/Hexlet/amocrm-ruby/commit/c5d17f30eca70a68ca3df7dd38bd38137d59ec0a)) + ## 0.6.0 (2026-04-30) Full Changelog: [v0.5.4...v0.6.0](https://github.com/Hexlet/amocrm-ruby/compare/v0.5.4...v0.6.0) diff --git a/Gemfile.lock b/Gemfile.lock index f375b8c..a859d8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - amocrm (0.6.0) + amocrm (0.6.1) cgi connection_pool diff --git a/README.md b/README.md index 89ec5ca..f351b44 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 "amocrm", "~> 0.6.0" +gem "amocrm", "~> 0.6.1" ``` diff --git a/lib/amocrm/internal/transport/base_client.rb b/lib/amocrm/internal/transport/base_client.rb index 239fc8a..dc74af9 100644 --- a/lib/amocrm/internal/transport/base_client.rb +++ b/lib/amocrm/internal/transport/base_client.rb @@ -306,6 +306,8 @@ def initialize( Amocrm::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end + headers.delete("content-type") if body.nil? + url = Amocrm::Internal::Util.join_parsed_uri( @base_url_components, {**req, path: path, query: query} diff --git a/lib/amocrm/version.rb b/lib/amocrm/version.rb index 1e2c368..4d6b68a 100644 --- a/lib/amocrm/version.rb +++ b/lib/amocrm/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Amocrm - VERSION = "0.6.0" + VERSION = "0.6.1" end diff --git a/test/amocrm/client_test.rb b/test/amocrm/client_test.rb index 62190ef..2673c15 100644 --- a/test/amocrm/client_test.rb +++ b/test/amocrm/client_test.rb @@ -257,8 +257,8 @@ def test_client_redirect_307 assert_equal(recorded.method, _1.method) assert_equal(recorded.body, _1.body) assert_equal( - recorded.headers.transform_keys(&:downcase).fetch("content-type"), - _1.headers.transform_keys(&:downcase).fetch("content-type") + recorded.headers.transform_keys(&:downcase)["content-type"], + _1.headers.transform_keys(&:downcase)["content-type"] ) end end @@ -356,8 +356,9 @@ def test_default_headers ) assert_requested(:any, /./) do |req| - headers = req.headers.transform_keys(&:downcase).fetch_values("accept", "content-type") - headers.each { refute_empty(_1) } + headers = req.headers.transform_keys(&:downcase) + expected = req.body.nil? ? ["accept"] : %w[accept content-type] + headers.fetch_values(*expected).each { refute_empty(_1) } end end end