flexirest 1.6.8 → 1.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/flexirest/request.rb +4 -1
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/request_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97942021a18075e99ef0ec8b44ddcfc65666ccf2
|
4
|
+
data.tar.gz: 0e65b5b0d7cc7ce9248118eb2d87bde8a4cb51d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83f1b98ee42cc11c26edb512b85e30c050affd2d9efed3d3ccaa9a497c342aa5690f5f0ea16be3c18a99a5edb5657d97c2fc4ef0a8ffbdfe3edda590e174c6d2
|
7
|
+
data.tar.gz: d61bd29b62610ad7e852d843391f83c6f19d0fa5ab427c9993264c875e76d7b97442fc5ad60a3f3666de2f204e67321d0e2a2833a9e4067f4bdaa23cffa1d69d
|
data/CHANGELOG.md
CHANGED
data/lib/flexirest/request.rb
CHANGED
@@ -524,7 +524,10 @@ module Flexirest
|
|
524
524
|
def handle_response(response, cached = nil)
|
525
525
|
@response = response
|
526
526
|
status = @response.status || 200
|
527
|
-
|
527
|
+
if @response.body.blank?
|
528
|
+
@response.response_headers['Content-Type'] = "application/json"
|
529
|
+
@response.body = "{}"
|
530
|
+
end
|
528
531
|
|
529
532
|
if cached && response.status == 304
|
530
533
|
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name}" +
|
data/lib/flexirest/version.rb
CHANGED
data/spec/lib/request_spec.rb
CHANGED
@@ -430,6 +430,11 @@ describe Flexirest::Request do
|
|
430
430
|
expect(ExampleClient.all).to be_truthy
|
431
431
|
end
|
432
432
|
|
433
|
+
it "should return true from 200 with empty bodies even if they don't have a correct content type" do
|
434
|
+
expect_any_instance_of(Flexirest::Connection).to receive(:get).with(any_args).and_return(::FaradayResponseMock.new(OpenStruct.new(status:200, response_headers:{"Content-Type" => "text/plain"}, body: nil)))
|
435
|
+
expect(ExampleClient.all).to be_truthy
|
436
|
+
end
|
437
|
+
|
433
438
|
it "should return a lazy loader object if lazy loading is enabled" do
|
434
439
|
object = LazyLoadedExampleClient.fake id:1234, debug:true
|
435
440
|
expect(object).to be_an_instance_of(Flexirest::LazyLoader)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flexirest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|