diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b989fa63..13d46a6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ jobs: github.repository == 'stainless-sdks/open-transit-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/open-transit-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/open-transit-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 b4655c4b..375a0380 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 535b6213..26bc434e 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'OneBusAway/ruby-sdk' && (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 cce9d1c6..56607252 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.7.0" + ".": "1.7.1" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index fa222e3a..6608e4d9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-a30b0967ffed17b866dc65b5528148a06a42cce7c3c6d8f740ae2f6079963e7d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit/open-transit-b625345de7b9c51744ddc6c75b8c37a159a536204481404cca91d7d6a859149d.yml openapi_spec_hash: 9bf1e5bf00ef9936a9181ebd0956d5b8 config_hash: c28ddf5b7754155603d9fd1c5fcaeeff diff --git a/CHANGELOG.md b/CHANGELOG.md index 47ac0124..d674db94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.7.1 (2026-05-14) + +Full Changelog: [v1.7.0...v1.7.1](https://github.com/OneBusAway/ruby-sdk/compare/v1.7.0...v1.7.1) + +### Bug Fixes + +* **client:** elide content type header on requests without body ([c8163aa](https://github.com/OneBusAway/ruby-sdk/commit/c8163aac1892c0bc83dce876b959451a5f63b031)) + ## 1.7.0 (2026-04-28) Full Changelog: [v1.6.4...v1.7.0](https://github.com/OneBusAway/ruby-sdk/compare/v1.6.4...v1.7.0) diff --git a/Gemfile.lock b/Gemfile.lock index 5c3b4bf1..a2792b2d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - onebusaway-sdk (1.7.0) + onebusaway-sdk (1.7.1) cgi connection_pool diff --git a/README.md b/README.md index 8fb70821..8c6baf68 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "onebusaway-sdk", "~> 1.7.0" +gem "onebusaway-sdk", "~> 1.7.1" ``` diff --git a/lib/onebusaway_sdk/internal/transport/base_client.rb b/lib/onebusaway_sdk/internal/transport/base_client.rb index e8b9d0b1..8b15a7b5 100644 --- a/lib/onebusaway_sdk/internal/transport/base_client.rb +++ b/lib/onebusaway_sdk/internal/transport/base_client.rb @@ -309,6 +309,8 @@ def initialize( OnebusawaySDK::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) end + headers.delete("content-type") if body.nil? + url = OnebusawaySDK::Internal::Util.join_parsed_uri( @base_url_components, {**req, path: path, query: query} diff --git a/lib/onebusaway_sdk/version.rb b/lib/onebusaway_sdk/version.rb index 0ffccedf..58757beb 100644 --- a/lib/onebusaway_sdk/version.rb +++ b/lib/onebusaway_sdk/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module OnebusawaySDK - VERSION = "1.7.0" + VERSION = "1.7.1" end diff --git a/test/onebusaway_sdk/client_test.rb b/test/onebusaway_sdk/client_test.rb index ed29983c..a92bc242 100644 --- a/test/onebusaway_sdk/client_test.rb +++ b/test/onebusaway_sdk/client_test.rb @@ -228,8 +228,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 @@ -319,8 +319,9 @@ def test_default_headers onebusaway_sdk.current_time.retrieve 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