protocol-http1 0.4.1 → 0.5.0
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/connection.rb +7 -7
- data/lib/protocol/http1/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12c9729522d079c4f935b879740c9b34b83ec7f1473cc84ece34c4ffb869a78c
|
4
|
+
data.tar.gz: 2e2f7259a77564235aaf3b99ab9aac1078f464a901f1371a7afb3b30a4773250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25e1bc8406ce40cf8093b4b4f5e966f3c615d0097767111ab2f2b1daed0a0e226d8a5911d4c3cad8b5f584305a7c47398ff6a0d523467416466241d7f78b3187
|
7
|
+
data.tar.gz: '0868212e349a7f2c060748ec315a147b056b660c664f4b4c8a79a5da16d3c542bfc4e7fa1b27b6d09185d9f55e51e13b83b4052479d24a0368b469c19f0e4250'
|
@@ -141,18 +141,18 @@ module Protocol
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
-
def
|
145
|
-
|
146
|
-
yield line
|
147
|
-
end
|
144
|
+
def read_line?
|
145
|
+
@stream.gets(CRLF, chomp: true)
|
148
146
|
end
|
149
147
|
|
150
148
|
def read_line
|
151
|
-
|
149
|
+
read_line? or raise EOFError
|
152
150
|
end
|
153
151
|
|
154
152
|
def read_request
|
155
|
-
|
153
|
+
return unless line = read_line?
|
154
|
+
|
155
|
+
method, path, version = line.split(/\s+/, 3)
|
156
156
|
headers = read_headers
|
157
157
|
|
158
158
|
@persistent = persistent?(version, headers)
|
@@ -184,7 +184,7 @@ module Protocol
|
|
184
184
|
def read_headers
|
185
185
|
fields = []
|
186
186
|
|
187
|
-
|
187
|
+
while line = read_line
|
188
188
|
if line =~ /^([a-zA-Z\-\d]+):\s*(.+?)\s*$/
|
189
189
|
fields << [$1, $2]
|
190
190
|
else
|