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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1343650ebb4ff1c792cfbb7a1ef8150a75f18d91
4
- data.tar.gz: 90f3d0901f336bff39266d6242ff8cd9cab96bf2
3
+ metadata.gz: 89fa69257c3fa40b1f60f8d8e184395f54eccbf3
4
+ data.tar.gz: f315787cb7c8f45b5bdebc5c9257a70619e0668b
5
5
  SHA512:
6
- metadata.gz: ac988b860a4e9c02a8f0f5cc0b4edc55bb398be4220bdaf4434908f7c29258b56a842ce0662b9c4c1f9ff6f63cabb1e8d58d39fd5b4922f91f842dbfe766518c
7
- data.tar.gz: 42ad8cfc4fa3636843586d144f09ec0a0ff067cdcfbd8c6fa1cae7efc6054f73d66a3cb2803e308732f7b60656212c59161247012290ac3b232e85077e293c4e
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
@@ -1,3 +1,3 @@
1
1
  module AuthenticatedClient
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  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.2
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-01-20 00:00:00.000000000 Z
11
+ date: 2017-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry