diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 862a05b6..642b9c69 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.2.4" + ".": "1.2.5" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 188826aa..579742f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.2.5 (2025-12-19) + +Full Changelog: [v1.2.4...v1.2.5](https://github.com/OneBusAway/ruby-sdk/compare/v1.2.4...v1.2.5) + +### Bug Fixes + +* issue where json.parse errors when receiving HTTP 204 with nobody ([862df13](https://github.com/OneBusAway/ruby-sdk/commit/862df13cf5d8d75baa25299a1ca160f4e3c436a5)) + ## 1.2.4 (2025-12-17) Full Changelog: [v1.2.3...v1.2.4](https://github.com/OneBusAway/ruby-sdk/compare/v1.2.3...v1.2.4) diff --git a/Gemfile.lock b/Gemfile.lock index 1c6ec84f..8a1c712b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - onebusaway-sdk (1.2.4) + onebusaway-sdk (1.2.5) connection_pool GEM diff --git a/README.md b/README.md index 6cb45f2d..fa84d8d5 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.2.4" +gem "onebusaway-sdk", "~> 1.2.5" ``` diff --git a/lib/onebusaway_sdk/internal/util.rb b/lib/onebusaway_sdk/internal/util.rb index 127049e1..9aa2e5f4 100644 --- a/lib/onebusaway_sdk/internal/util.rb +++ b/lib/onebusaway_sdk/internal/util.rb @@ -657,7 +657,8 @@ def force_charset!(content_type, text:) def decode_content(headers, stream:, suppress_error: false) case (content_type = headers["content-type"]) in OnebusawaySDK::Internal::Util::JSON_CONTENT - json = stream.to_a.join + return nil if (json = stream.to_a.join).empty? + begin JSON.parse(json, symbolize_names: true) rescue JSON::ParserError => e @@ -667,7 +668,11 @@ def decode_content(headers, stream:, suppress_error: false) in OnebusawaySDK::Internal::Util::JSONL_CONTENT lines = decode_lines(stream) chain_fused(lines) do |y| - lines.each { y << JSON.parse(_1, symbolize_names: true) } + lines.each do + next if _1.empty? + + y << JSON.parse(_1, symbolize_names: true) + end end in %r{^text/event-stream} lines = decode_lines(stream) diff --git a/lib/onebusaway_sdk/version.rb b/lib/onebusaway_sdk/version.rb index 8b6451d6..09c70e99 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.2.4" + VERSION = "1.2.5" end