async-webdriver 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/async/webdriver/connection.rb +10 -1
- data/lib/async/webdriver/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fab04165eba20d959a8d0016d33475e838f0b3d30f54ddc15827f9153cbbfecb
|
|
4
|
+
data.tar.gz: dc3933f0abe24f936993eb13e1531ab74e3b94642c8c1e8f35e4570d4a2574ea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b3b3ba2ab5a423e5935643ed2d579f62ad5b20b571bc0364e65d72b37cc6820d5f14a3df00eb103b99ce2b2a02cb10ecdf8ee5767304658bf30b746dd768b105
|
|
7
|
+
data.tar.gz: b6466ab0b8b85d0b5b270789aa414c8d34d609d5f9c7e25a89b6986aa00c48bad6587b4c22f7d7a3a9893c8d416de560994e35f1f3786fe58945b3d78b18c1ae
|
data/Gemfile.lock
CHANGED
|
@@ -2,6 +2,7 @@ require "async"
|
|
|
2
2
|
require "async/queue"
|
|
3
3
|
require "async/http/internet"
|
|
4
4
|
require "json"
|
|
5
|
+
require "base64"
|
|
5
6
|
|
|
6
7
|
module Async
|
|
7
8
|
module Webdriver
|
|
@@ -25,6 +26,14 @@ module Async
|
|
|
25
26
|
|
|
26
27
|
private
|
|
27
28
|
|
|
29
|
+
def headers_with_basic_auth(headers)
|
|
30
|
+
return headers if !@url.include?('@') || headers.any? { |h| h.start_with?('Authorization') }
|
|
31
|
+
|
|
32
|
+
credentials = Base64.urlsafe_encode64(@url.split('@').first.gsub(/\w+:\/\//, ''), padding: false)
|
|
33
|
+
|
|
34
|
+
headers.concat(["Authorization: Basic #{credentials}"])
|
|
35
|
+
end
|
|
36
|
+
|
|
28
37
|
def async_call(method:, path:, headers:, body:nil)
|
|
29
38
|
body_array = case body
|
|
30
39
|
when Hash
|
|
@@ -37,7 +46,7 @@ module Async
|
|
|
37
46
|
@url
|
|
38
47
|
end
|
|
39
48
|
|
|
40
|
-
r = @internet.call method.upcase, path_or_url, headers, body_array
|
|
49
|
+
r = @internet.call method.upcase, path_or_url, headers_with_basic_auth(headers), body_array
|
|
41
50
|
|
|
42
51
|
body = begin
|
|
43
52
|
JSON.parse r.read
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: async-webdriver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matti Paksula
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-01-
|
|
11
|
+
date: 2019-01-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: async-http
|