rfetion 0.4.5 → 0.4.6
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.
- data/VERSION +1 -1
- data/lib/rfetion/fetion.rb +4 -4
- data/rfetion.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.6
|
data/lib/rfetion/fetion.rb
CHANGED
@@ -9,7 +9,6 @@ class Fetion
|
|
9
9
|
FETION_LOGIN_URL = 'https://uid.fetion.com.cn/ssiportal/SSIAppSignIn.aspx'
|
10
10
|
FETION_CONFIG_URL = 'http://nav.fetion.com.cn/nav/getsystemconfig.aspx'
|
11
11
|
FETION_SIPP = 'SIPP'
|
12
|
-
GUID = ::Guid.new.to_s
|
13
12
|
@nonce = nil
|
14
13
|
|
15
14
|
def initialize
|
@@ -20,6 +19,7 @@ class Fetion
|
|
20
19
|
@logger = Logger.new(STDOUT)
|
21
20
|
@logger.level = Logger::INFO
|
22
21
|
@cat = true
|
22
|
+
@guid = ::Guid.new.to_s
|
23
23
|
end
|
24
24
|
|
25
25
|
def logger_level=(level)
|
@@ -127,7 +127,7 @@ class Fetion
|
|
127
127
|
http = Net::HTTP.new(uri.host, uri.port)
|
128
128
|
http.use_ssl = true
|
129
129
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
130
|
-
headers = {'Content-Type' => 'application/oct-stream', 'Pragma' => "xz4BBcV#{
|
130
|
+
headers = {'Content-Type' => 'application/oct-stream', 'Pragma' => "xz4BBcV#{@guid}", 'User-Agent' => 'IIC2.0/PC 3.2.0540'}
|
131
131
|
response = http.request_get(uri.request_uri, headers)
|
132
132
|
|
133
133
|
raise FetionException.new('Fetion Error: Login failed.') unless response.is_a? Net::HTTPSuccess
|
@@ -348,7 +348,7 @@ class Fetion
|
|
348
348
|
@logger.debug "body: #{body}"
|
349
349
|
uri = URI.parse(url)
|
350
350
|
http = Net::HTTP.new(uri.host, uri.port)
|
351
|
-
headers = {'Content-Type' => 'application/oct-stream', 'Pragma' => "xz4BBcV#{
|
351
|
+
headers = {'Content-Type' => 'application/oct-stream', 'Pragma' => "xz4BBcV#{@guid}", 'User-Agent' => 'IIC2.0/PC 3.2.0540', 'Cookie' => "ssic=#{@ssic}"}
|
352
352
|
response = http.request_post(uri.request_uri, body, headers)
|
353
353
|
|
354
354
|
@logger.debug "response: #{response.inspect}"
|
@@ -376,7 +376,7 @@ class Fetion
|
|
376
376
|
end
|
377
377
|
|
378
378
|
def calc_cnonce
|
379
|
-
Digest::MD5.hexdigest(
|
379
|
+
Digest::MD5.hexdigest(@guid).upcase
|
380
380
|
end
|
381
381
|
|
382
382
|
def hash_password
|
data/rfetion.gemspec
CHANGED