hermeneutics 1.19 → 1.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hermeneutics/cgi.rb +1 -1
- data/lib/hermeneutics/message.rb +9 -12
- data/lib/hermeneutics/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7351afc067372841e6fb5c69bb96adcac7da7fb096fc4dce59ac7717edec4ee
|
4
|
+
data.tar.gz: b6b44ac32989d86b8d43ac774e5bb54994fc36412ec9881e70670e4f7c17ade8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a25ca9a02a251f4f4bd48c0bf944aa9686d3ae7a71881fd934eefeb5b78a017f8e72e65418178532e46f9e3972e95c1cfd255a6bcc36e2aa32d8b778505a832
|
7
|
+
data.tar.gz: 9717ee81ba5eeca02aa8b9557e2cf7d83c1494b5ade0d3c65c2745df9b4aad6718cb7834c932e55191f1c28256a0cde30caaa3898af1d748100ee33cbdf9fb18
|
data/lib/hermeneutics/cgi.rb
CHANGED
@@ -151,7 +151,7 @@ module Hermeneutics
|
|
151
151
|
when "GET", "HEAD" then
|
152
152
|
Data::UrlEnc.new query_string
|
153
153
|
when "POST" then
|
154
|
-
data = $stdin.read
|
154
|
+
data = $stdin.binmode.read
|
155
155
|
data.bytesize == content_length.to_i or
|
156
156
|
warn "Content length #{content_length} is wrong (#{data.bytesize})."
|
157
157
|
ct = ContentType.parse content_type
|
data/lib/hermeneutics/message.rb
CHANGED
@@ -23,13 +23,12 @@ module Hermeneutics
|
|
23
23
|
def parse input, **parameters
|
24
24
|
b = parameters[ :boundary]
|
25
25
|
b or raise ParseError, "Missing boundary parameter."
|
26
|
-
input.encode! input.encoding, universal_newline: true
|
27
26
|
list = input.split /^--#{Regexp.quote b}/
|
28
27
|
prolog = list.shift
|
29
28
|
epilog = list.pop
|
30
|
-
epilog and epilog.slice! /\A--\n/ or raise "Missing last separator."
|
29
|
+
epilog and epilog.slice! /\A--\r?\n/ or raise "Missing last separator."
|
31
30
|
list.each { |p|
|
32
|
-
p.slice! /\A\n/ or raise "Malformed separator: #{b + p[/.*/]}."
|
31
|
+
p.slice! /\A\r?\n/ or raise "Malformed separator: #{b + p[/.*/]}."
|
33
32
|
}
|
34
33
|
list.map! { |t| Message.parse t }
|
35
34
|
new b, prolog, list, epilog
|
@@ -483,14 +482,11 @@ module Hermeneutics
|
|
483
482
|
private
|
484
483
|
|
485
484
|
def parse_hb input
|
486
|
-
hinput,
|
485
|
+
hinput, b = input.split /^\r?\n/, 2
|
487
486
|
h = parse_headers hinput
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
b = ""
|
492
|
-
input.each_line { |l| b << l }
|
493
|
-
b
|
487
|
+
b ||= b.to_s
|
488
|
+
if (c = h.content_type) and (bc = c.parse_mime b) then
|
489
|
+
b = bc
|
494
490
|
end
|
495
491
|
yield h, b
|
496
492
|
end
|
@@ -590,8 +586,9 @@ module Hermeneutics
|
|
590
586
|
else
|
591
587
|
@body.chomp
|
592
588
|
end
|
593
|
-
c = @headers.content_type
|
594
|
-
|
589
|
+
if (c = @headers.content_type) and (cs = c[ :charset]) then
|
590
|
+
r.force_encoding cs
|
591
|
+
end
|
595
592
|
r
|
596
593
|
end
|
597
594
|
|
data/lib/hermeneutics/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hermeneutics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.20'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bertram Scharpf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: supplement
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements:
|
99
99
|
- Ruby, at least 3.0
|
100
|
-
rubygems_version: 3.4.
|
100
|
+
rubygems_version: 3.4.20
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: CGI and mail handling
|