web-connect 0.4.13 → 0.4.14
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0091a07c1eed416170772b0b372bf7a67d07f3b
|
4
|
+
data.tar.gz: e8b5a76d60a63a5905d5789c0fcb7fbc930c008e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56f5c259161af9445688c69243e03ceb03960bcda139c0bae524417dd27720da9e31760a36b9518ef277439f0778109230f3e61276adf497c6678d8141202fb3
|
7
|
+
data.tar.gz: 2bbc7b22019d05b8e344174bc20bed10c44389049bfb1855c9a4406ca6143bad5012a029ceed9653a98b755139855c5fefdaa43b505756d0f31a7b4ca950febd
|
@@ -37,7 +37,7 @@ module Netfira::WebConnect
|
|
37
37
|
|
38
38
|
# Used by older downstream methods, e.g. newOrders, newInboundDocuments etc
|
39
39
|
def to_deprecated_downstream
|
40
|
-
fields = attributes_as_camel_cased_hash
|
40
|
+
fields = attributes_as_camel_cased_hash(true)
|
41
41
|
if sendable?
|
42
42
|
sendable_fields = {
|
43
43
|
"#{self.class.single_name_camel}GUID" => guid.to_s,
|
@@ -53,14 +53,19 @@ module Netfira::WebConnect
|
|
53
53
|
@guid ||= Guid.from(self[:guid])
|
54
54
|
end
|
55
55
|
|
56
|
-
def guid=(
|
56
|
+
def guid=(_)
|
57
57
|
raise 'GUIDs are read-only'
|
58
58
|
end
|
59
59
|
|
60
60
|
private
|
61
61
|
|
62
|
-
def attributes_as_camel_cased_hash
|
63
|
-
self.class.attributes_to_send.map
|
62
|
+
def attributes_as_camel_cased_hash(stringify = false)
|
63
|
+
self.class.attributes_to_send.map do |key|
|
64
|
+
value = __send__(key)
|
65
|
+
value = value.to_f if BigDecimal === value
|
66
|
+
value = value.to_s if stringify
|
67
|
+
[key.camelize(:lower), value]
|
68
|
+
end.to_h
|
64
69
|
end
|
65
70
|
|
66
71
|
def deprecated_downstream_children
|
@@ -41,10 +41,19 @@ module Netfira::WebConnect
|
|
41
41
|
env['original.rack.input'] = input = env['rack.input']
|
42
42
|
|
43
43
|
input = case env['CONTENT_ENCODING'] || env['HTTP_CONTENT_ENCODING']
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
when 'gzip'
|
45
|
+
Zlib::GzipReader.new(input)
|
46
|
+
when 'deflate'
|
47
|
+
begin
|
48
|
+
# Decompression of .Net-flavoured deflate
|
49
|
+
StringIO.new(Zlib::Inflate.new(-15).inflate input.read)
|
50
|
+
rescue Zlib::DataError
|
51
|
+
# Decompression of regular (Ruby, PHP etc) deflate
|
52
|
+
StringIO.new(Zlib::Inflate.inflate input.tap(&:rewind).read)
|
53
|
+
end
|
54
|
+
else
|
55
|
+
input
|
56
|
+
end
|
48
57
|
|
49
58
|
method, path, query_string, headers, body = parse_request(input)
|
50
59
|
|