apia 3.10.0 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3aacd55e16d85ac583d7b03ecf16a404174b41cc39c9ddd836157845b7ff5b44
4
- data.tar.gz: de3681316508f67bc6a605b99a2cc2d3024daa94de7f99859aba55b326dfb78b
3
+ metadata.gz: 7cd0dbcd14812e65291d8b131143f01a8feed3cc44d6bb97d31cd3a103095bf4
4
+ data.tar.gz: 2863eb4b39e177ad2cd6082a8cd2be104e7d56cb28918e60934b9f33ab20b1fb
5
5
  SHA512:
6
- metadata.gz: a19a5124b419464ba1e7577df5fc7b8b68d149233e55a20bc5e8230bff989c5eeb8a861c2f39dcebea76e2e6d6dd9a05ba31006bfd92370b10ab9093676f4534
7
- data.tar.gz: 5a921f878a7586db2ba33d525390297f23e6e5b97b9a66809c127d1c30f1c050ae2bbcc06e0b865292679db6145f01d820de497fa9f33bada643ac1e014e050c
6
+ metadata.gz: 2eccd31e011a1a950213b9b03d266d47a7023d36d206a38e8a964e629de6fd196e46eec1d676e3ff5a69f419d7886c802989cef88d4e6856690d3b8824525eec
7
+ data.tar.gz: 38e59fb2599e48f3cc0945a4f1330cfe48f89eb1c183dcafe46d675201668ab3396f884c4a363222d568c75536f3a2ee539589d68d65f492348c1efadd699da0
data/lib/apia/response.rb CHANGED
@@ -71,11 +71,10 @@ module Apia
71
71
  # @return [Array]
72
72
  def rack_triplet
73
73
  # Errors will always be sent as a hash intended for JSON encoding,
74
- # even if the endpoint specifies a plain text response, so only
75
- # send a pain response if the type is plaintext _and_ the body is
76
- # a string
77
- if @type == PLAIN && body.is_a?(String)
78
- Rack.plain_triplet(body, headers: headers, status: status)
74
+ # even if the endpoint specifies a non-JSON response, so only send a
75
+ # plain response if the type is not JSON _and_ the body is a string.
76
+ if @type != JSON && body.is_a?(String)
77
+ Rack.response_triplet(body, content_type: @type, headers: headers, status: status)
79
78
  else
80
79
  Rack.json_triplet(body, headers: headers, status: status)
81
80
  end
data/lib/apia/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Apia
4
4
 
5
- VERSION = '3.10.0'
5
+ VERSION = '3.11.0'
6
6
 
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-29 00:00:00.000000000 Z
11
+ date: 2026-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64