spaceship 0.31.3 → 0.31.4

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: 2fe4d4d037f3de23d557df17eed9259baa3ec1d8
4
- data.tar.gz: 8d683121c7aa2d8398b9e00ce51fbb1370587b4e
3
+ metadata.gz: bd45532db42b2f9e5109b0c8a4599d2c15126f98
4
+ data.tar.gz: 5004398d445aac59be22238a10dad3ca9d76c3aa
5
5
  SHA512:
6
- metadata.gz: 1623061c723161aa674a9f0c87c5ef9c18ada9660ef143c899ceb649a01c56e652210b0ca711ec96e94ef7caf872213b896061c4c5cf59d1cf9f8a0f7643ce00
7
- data.tar.gz: 020b72b86c9111a0c3c2aed68b881187310d6c027be2911b3d38d54d450a699ff2ff3be31edf12794e728d4a186073a3de7f097284e5af664f1fa4122578d452
6
+ metadata.gz: a989f4f950571729cc3fc0fcea44ad00de6d3028c29ba26e26b9d2381f71b6c9ae264a97f3893dd29624dd9c7739787ec7931f2379cfb88bfb4906038b655554
7
+ data.tar.gz: e7d0e65f033992040cb4ba17b039609d9231809045d3fa9a8457f5e14db18420f4b3761603bfa79ac2d84ce51b2ccbb5d3a54e0db0012a6dc6c712e43b9836c5
@@ -171,7 +171,6 @@ module Spaceship
171
171
  params.merge!(ident_params)
172
172
 
173
173
  ensure_csrf
174
-
175
174
  r = request(:post, "account/#{platform_slug(mac)}/identifiers/addAppId.action", params)
176
175
  parse_response(r, 'appId')
177
176
  end
@@ -387,17 +386,21 @@ module Spaceship
387
386
  private
388
387
 
389
388
  def ensure_csrf
390
- if csrf_tokens.count == 0
391
- # If we directly create a new resource (e.g. app) without querying anything before
392
- # we don't have a valid csrf token, that's why we have to do at least one request
393
- apps
394
-
395
- # Update 18th August 2016
396
- # For some reason, we have to query the resource twice to actually get a valid csrf_token
397
- # I couldn't find out why, the first response does have a valid Set-Cookie header
398
- # But it still needs this second request
399
- apps
400
- end
389
+ # It's important we store this state here
390
+ # as we always want to request something at least once
391
+ return unless @requested_csrf_token.nil?
392
+
393
+ # If we directly create a new resource (e.g. app) without querying anything before
394
+ # we don't have a valid csrf token, that's why we have to do at least one request
395
+ Certificate::Production.all
396
+
397
+ # Update 18th August 2016
398
+ # For some reason, we have to query the resource twice to actually get a valid csrf_token
399
+ # I couldn't find out why, the first response does have a valid Set-Cookie header
400
+ # But it still needs this second request
401
+ Certificate::Production.all
402
+
403
+ @requested_csrf_token = true if csrf_tokens.count > 0
401
404
  end
402
405
  end
403
406
  end
@@ -1,4 +1,4 @@
1
1
  module Spaceship
2
- VERSION = "0.31.3".freeze
2
+ VERSION = "0.31.4".freeze
3
3
  DESCRIPTION = "Ruby library to access the Apple Dev Center and iTunes Connect".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaceship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.3
4
+ version: 0.31.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -391,7 +391,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
391
391
  version: '0'
392
392
  requirements: []
393
393
  rubyforge_project:
394
- rubygems_version: 2.5.1
394
+ rubygems_version: 2.2.2
395
395
  signing_key:
396
396
  specification_version: 4
397
397
  summary: Ruby library to access the Apple Dev Center and iTunes Connect