gloo-web 1.0 → 1.1
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/lib/web_svr/request.rb +1 -1
- data/lib/web_svr/request_params.rb +39 -33
- 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: b7fbfaa7f208510b4d12410fa16262bb538e95b42eed297082a801c6ea14fc72
|
|
4
|
+
data.tar.gz: e24a557148c2113ac7ec0a7eb03adcffdd0ccf905813e4bb5425290ef38b8673
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b247946511ec4b467ee39fd4a70b26ba4745b3861fe0c43f63cdd1effb2c8984cef697bc224d163c529963acc79fb22f98cfe78b7c0eb09733a4369a5170c315
|
|
7
|
+
data.tar.gz: 6c061b2be098433c97292ea0da5b4ac694c850032de46dcb3a2c928c9332241de6082f7f62b1933c7694c474c6cf335e6540a8e31ddb89e339d2008a25febea4
|
data/lib/web_svr/request.rb
CHANGED
|
@@ -23,7 +23,8 @@ module WebSvr
|
|
|
23
23
|
#
|
|
24
24
|
# Set up the web server.
|
|
25
25
|
#
|
|
26
|
-
def initialize( log )
|
|
26
|
+
def initialize( engine, log )
|
|
27
|
+
@engine = engine
|
|
27
28
|
@log = log
|
|
28
29
|
end
|
|
29
30
|
|
|
@@ -66,38 +67,43 @@ module WebSvr
|
|
|
66
67
|
# This is very rough and will need to be fixed.
|
|
67
68
|
#
|
|
68
69
|
def init_multipart body
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
70
|
+
begin
|
|
71
|
+
# puts "*********** first lines: *********** "
|
|
72
|
+
# body.lines[0..3].each { |line| puts line }
|
|
73
|
+
# puts "*********** last lines: *********** "
|
|
74
|
+
# body.lines.last(5).each { |line| puts line }
|
|
75
|
+
# puts "************************************"
|
|
76
|
+
|
|
77
|
+
# boundary = body.lines.first
|
|
78
|
+
# puts "boundary: #{boundary}"
|
|
79
|
+
|
|
80
|
+
header = body.lines[1..3].join
|
|
81
|
+
# puts "header: #{header}"
|
|
82
|
+
|
|
83
|
+
footer = body.lines.last(5).join
|
|
84
|
+
# puts "footer: #{footer}"
|
|
85
|
+
|
|
86
|
+
binary_data = body.lines[4..-6].join
|
|
87
|
+
# puts "binary_data length: #{binary_data.length}"
|
|
88
|
+
# puts "binary first line: #{binary_data.lines.first}"
|
|
89
|
+
# puts "binary last line: #{binary_data.lines.last}"
|
|
90
|
+
|
|
91
|
+
i = header.lines.first.index( 'filename=' )
|
|
92
|
+
filename = header.lines.first[ i+10..-4 ]
|
|
93
|
+
content_type = header.lines.second[14..-3]
|
|
94
|
+
# puts "filename: #{filename}"
|
|
95
|
+
# puts "content_type: #{content_type}"
|
|
96
|
+
|
|
97
|
+
@body_binary = body
|
|
98
|
+
@body_params = {}
|
|
99
|
+
@body_params[ 'content_type' ] = content_type
|
|
100
|
+
@body_params[ 'file_name' ] = filename
|
|
101
|
+
@body_params[ 'file_size' ] = binary_data.length
|
|
102
|
+
@body_params[ 'file_data' ] = binary_data
|
|
103
|
+
rescue => ex
|
|
104
|
+
@engine.log_exception ex
|
|
105
|
+
# @log.error "Error parsing multipart request", ex
|
|
106
|
+
end
|
|
101
107
|
end
|
|
102
108
|
|
|
103
109
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gloo-web
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '1.
|
|
4
|
+
version: '1.1'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Crane
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thin
|