scooter 4.5.3 → 4.5.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 140f45ad0b9707ef584006662c830aa1965f8e7ca2c5b593a3f0d6b5bb36f0b8
|
4
|
+
data.tar.gz: beae0106ed41a25240446b225eeebeada7f75b5174ba2eb148a7e763ad790543
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3784b635e886af9fb0af04f11c107269da4b3cdfe45256d0ab5a7cd680e47c8bd69b9cb722cbcc3a28184ca22f4c8dd4b84ae18f8c96dbfc3fd6e5633e34d551
|
7
|
+
data.tar.gz: a13caa8a225e042e5333ac669c9512cb2b57321eccc373f91d83d2e27f0c12f7a7a9c3a44e14469421d892ab3cd8bfe07f5fe8c09634ed42712c9925b9621fba
|
data/README.md
CHANGED
@@ -88,8 +88,13 @@ module Scooter
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def signin(login=self.credentials.login, password=self.credentials.password)
|
91
|
+
response = @connection.get "https://#{host}/auth/login"
|
92
|
+
return response if response.status != 200
|
93
|
+
# extract the session cookie, if it is present
|
94
|
+
cookie = response.headers['Set-Cookie']
|
91
95
|
response = @connection.post "/auth/login" do |request|
|
92
96
|
request.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
|
97
|
+
request.headers['Cookie'] = cookie if cookie
|
93
98
|
request.body = "username=#{login}&password=#{CGI.escape(password)}"
|
94
99
|
connection.port = 443
|
95
100
|
end
|
data/lib/scooter/version.rb
CHANGED
@@ -28,6 +28,12 @@ module Scooter
|
|
28
28
|
|
29
29
|
context '"signin with a page that returns a token' do
|
30
30
|
before do
|
31
|
+
stub_request(:get, /auth\/login/).
|
32
|
+
to_return(status: 200,
|
33
|
+
body: '',
|
34
|
+
headers: {
|
35
|
+
"set-cookie"=>"__HOST-somecookie=something;Secure;Path=/",
|
36
|
+
})
|
31
37
|
stub_request(:post, /auth\/login/).
|
32
38
|
to_return(status: 200,
|
33
39
|
body: '',
|
@@ -35,7 +41,7 @@ module Scooter
|
|
35
41
|
"date"=>"Tue, 29 Nov 2016 22:05:41 GMT",
|
36
42
|
"content-length"=>"0",
|
37
43
|
"connection"=>"close",
|
38
|
-
"set-cookie"=>"
|
44
|
+
"set-cookie"=>"pl_ssti=0CeHhpz5PPLna7kpaEMcTHjJ62z9eizHTzsxEXNK8W20;Secure;Path=/",
|
39
45
|
"location"=>"/",
|
40
46
|
"x-frame-options"=>"DENY"})
|
41
47
|
|