protocol-http1 0.10.2 → 0.10.3
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.
Potentially problematic release.
This version of protocol-http1 might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/protocol/http1/body/fixed.rb +2 -0
- data/lib/protocol/http1/connection.rb +22 -1
- data/lib/protocol/http1/version.rb +1 -1
- data/protocol-http1.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6860775fdc28f8e8d173ff80296cefa5c5e1505e70ce264876959fb453beab5a
|
4
|
+
data.tar.gz: 9985d69a3696bc98c2e01b78d29282220c9b90b968d0030d60ed95b26a3bab14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33093bb74d0b00b2a3dfded4432c66276ff27d6fe4e1137b4f0b867b51ca5aa1add02512b3f9427b2520be1617bf3e2c039ed497c192a686cc237bb4a65f690f
|
7
|
+
data.tar.gz: c845bf16f06d9798553a6241ffd3fae1692584bf6ff276437e1ab7828773200716b86be3b15a5808956ac74389852a2772c81b29fdbb6599a6da1bfe1a8bb9ee
|
@@ -28,6 +28,7 @@ require_relative 'error'
|
|
28
28
|
require_relative 'body/chunked'
|
29
29
|
require_relative 'body/fixed'
|
30
30
|
require_relative 'body/remainder'
|
31
|
+
require 'protocol/http/body/head'
|
31
32
|
|
32
33
|
require 'protocol/http/methods'
|
33
34
|
|
@@ -378,6 +379,10 @@ module Protocol
|
|
378
379
|
Body::Remainder.new(@stream)
|
379
380
|
end
|
380
381
|
|
382
|
+
def read_head_body(length)
|
383
|
+
Protocol::HTTP::Body::Head.new(length)
|
384
|
+
end
|
385
|
+
|
381
386
|
def read_tunnel_body
|
382
387
|
read_remainder_body
|
383
388
|
end
|
@@ -396,7 +401,23 @@ module Protocol
|
|
396
401
|
# code is always terminated by the first empty line after the
|
397
402
|
# header fields, regardless of the header fields present in the
|
398
403
|
# message, and thus cannot contain a message body.
|
399
|
-
if method == HTTP::Methods::HEAD
|
404
|
+
if method == HTTP::Methods::HEAD
|
405
|
+
if content_length = headers.delete(CONTENT_LENGTH)
|
406
|
+
length = Integer(content_length)
|
407
|
+
|
408
|
+
if length > 0
|
409
|
+
return read_head_body(length)
|
410
|
+
elsif length == 0
|
411
|
+
return nil
|
412
|
+
else
|
413
|
+
raise BadRequest, "Invalid content length: #{content_length}"
|
414
|
+
end
|
415
|
+
else
|
416
|
+
return nil
|
417
|
+
end
|
418
|
+
end
|
419
|
+
|
420
|
+
if (status >= 100 and status < 200) or status == 204 or status == 304
|
400
421
|
return nil
|
401
422
|
end
|
402
423
|
|
data/protocol-http1.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_dependency "protocol-http", "~> 0.
|
23
|
+
spec.add_dependency "protocol-http", "~> 0.15"
|
24
24
|
|
25
25
|
spec.add_development_dependency "covered"
|
26
26
|
spec.add_development_dependency "bundler"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-http1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: protocol-http
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.15'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.15'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: covered
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|