flexirest 1.4.8 → 1.4.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 +2 -1
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/request_spec.rb +11 -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: fb5d697d79a1b6068d551ea5346b87d83189eaad
|
4
|
+
data.tar.gz: 727a87951be313b214bcfd7d20a63eae1020e6b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a2122e343b6ac01a63e2fb0b872f0e03a00d5fd7ee1337df1258bac60bcc2f6fa859e15e3df04ef6fe35ed5575165bbb5b2cd001f2adc32238f8f6449e75a7a
|
7
|
+
data.tar.gz: a29e038eba07930db404505bcf59e0e7cb39f2e807eff1bfdc3fb8cbe64f1addb1fd7f1824f4815b1334c775864011c261d1fdbebce04907dbf22176531fe43e
|
data/CHANGELOG.md
CHANGED
data/lib/flexirest/request.rb
CHANGED
@@ -470,7 +470,8 @@ module Flexirest
|
|
470
470
|
if @method[:options][:plain]
|
471
471
|
return @response = Flexirest::PlainResponse.from_response(response)
|
472
472
|
elsif [202, 204].include?(status) && @response.body.blank?
|
473
|
-
|
473
|
+
@response.body = "{}"
|
474
|
+
return @response = Flexirest::PlainResponse.from_response(response)
|
474
475
|
elsif is_json_response? || is_xml_response?
|
475
476
|
if @response.respond_to?(:proxied) && @response.proxied
|
476
477
|
Flexirest::Logger.debug " \033[1;4;32m#{Flexirest.name}\033[0m #{@instrumentation_name} - Response was proxied, unable to determine size"
|
data/lib/flexirest/version.rb
CHANGED
data/spec/lib/request_spec.rb
CHANGED
@@ -34,6 +34,7 @@ describe Flexirest::Request do
|
|
34
34
|
get :plain, "/plain/:id", plain: true
|
35
35
|
post :create, "/create"
|
36
36
|
post :test_encoding, "/encoding", request_body_type: :json
|
37
|
+
post :testing_no_content_headers, "/no-content"
|
37
38
|
put :update, "/put/:id"
|
38
39
|
put :conversion, "/put/:id", parse_fields: [:converted]
|
39
40
|
delete :remove, "/remove/:id"
|
@@ -556,6 +557,16 @@ describe Flexirest::Request do
|
|
556
557
|
VerboseExampleClient.all
|
557
558
|
end
|
558
559
|
|
560
|
+
it "should return the headers still for 202 responses" do
|
561
|
+
fake_location = "https://foo.example.com/123"
|
562
|
+
expect_any_instance_of(Flexirest::Connection).
|
563
|
+
to receive(:post).
|
564
|
+
with("/no-content", "", an_instance_of(Hash)).
|
565
|
+
and_return(::FaradayResponseMock.new(OpenStruct.new(body:"", response_headers:{"location" => fake_location}, status:202)))
|
566
|
+
response = ExampleClient.testing_no_content_headers
|
567
|
+
expect(response._headers["location"]).to eq(fake_location)
|
568
|
+
end
|
569
|
+
|
559
570
|
it "should raise an unauthorised exception for 401 errors" do
|
560
571
|
expect_any_instance_of(Flexirest::Connection).
|
561
572
|
to receive(:post).
|
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.4.
|
4
|
+
version: 1.4.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: 2017-09-
|
11
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|