protocol-http1 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of protocol-http1 might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/protocol/http1/connection.rb +11 -0
- data/lib/protocol/http1/error.rb +6 -0
- data/lib/protocol/http1/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: 661cff536d9832701aaf027d558729e8d0e060becd87e07f76d5903bd10813de
|
4
|
+
data.tar.gz: 3362cd5687c0bcbc5a8774479d8a15a5be0d02ae9acc4dd0651bb1fec4335f1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 467de24fe8851f44b9ff67429fd47fc87b25f048e6914041f63f6332137b22702677627c0d46bd995304ae816a4f4b29f786f8499471ca5838fa942a10ea83e3
|
7
|
+
data.tar.gz: '068f57168286dfd5db966e59aa6aa35c9164fa3402bd95cb488bc5ba746e2f12c418b46fce3c5f605f7d7c1299a272f3077422daea0fb247f1f88168b4b612bb'
|
@@ -27,6 +27,8 @@ require_relative 'body/chunked'
|
|
27
27
|
require_relative 'body/fixed'
|
28
28
|
require_relative 'body/remainder'
|
29
29
|
|
30
|
+
require 'protocol/http/methods'
|
31
|
+
|
30
32
|
module Protocol
|
31
33
|
module HTTP1
|
32
34
|
CONTENT_LENGTH = 'content-length'.freeze
|
@@ -146,6 +148,15 @@ module Protocol
|
|
146
148
|
return unless line = read_line?
|
147
149
|
|
148
150
|
method, path, version = line.split(/\s+/, 3)
|
151
|
+
|
152
|
+
unless HTTP::Methods.const_defined?(method)
|
153
|
+
raise InvalidMethod, method
|
154
|
+
end
|
155
|
+
|
156
|
+
unless method and path and version
|
157
|
+
raise InvalidRequest, line.inspect
|
158
|
+
end
|
159
|
+
|
149
160
|
headers = read_headers
|
150
161
|
|
151
162
|
@persistent = persistent?(version, headers)
|
data/lib/protocol/http1/error.rb
CHANGED
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.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: protocol-http
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.0.
|
126
|
+
rubygems_version: 3.0.3
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: A low level implementation of the HTTP/1 protocol.
|