authenticated_client 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authenticated_client/auth_client.rb +2 -1
- data/lib/authenticated_client/version.rb +1 -1
- 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: 89fa69257c3fa40b1f60f8d8e184395f54eccbf3
|
4
|
+
data.tar.gz: f315787cb7c8f45b5bdebc5c9257a70619e0668b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84fbd1677ced99fa534a4080c880de02ac120f5686fe387bebe0ec05e199428bb76a3c24de71b6fc754f9f76ec71110ef69fcb18ad0bf741c8e33aeea69b4357
|
7
|
+
data.tar.gz: 6f688a72067c482c5468b21286df1529a145331ce43a7abfea9d67c0658734f9b9c97dd3f41429eba36a8f564c00f71a71a5d4eb69237f231fc52fd97bcb3343
|
@@ -26,7 +26,7 @@ module AuthenticatedClient
|
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
|
-
def perform_http_request
|
29
|
+
def perform_http_request(csrf_header = 'X-CSRF-Validation')
|
30
30
|
uri = URI.parse(@url)
|
31
31
|
uri.query = URI.encode_www_form( @parameters )
|
32
32
|
http = Net::HTTP.new(uri.host, uri.port)
|
@@ -34,6 +34,7 @@ module AuthenticatedClient
|
|
34
34
|
request = Net::HTTP::Post.new(uri.request_uri) if :post == @verb
|
35
35
|
request = Net::HTTP::Get.new(uri.request_uri) if :get == @verb
|
36
36
|
request.add_field("AUTHORIZATION", @token) if @token
|
37
|
+
request.add_field(csrf_header, '')
|
37
38
|
request.body = body.to_json
|
38
39
|
http.request(request)
|
39
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authenticated_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barney de Villiers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|