Skip to content

Commit 490f13b

Browse files
committed
Update connection.rb
Follow the naming conventions of the RFC.
1 parent 3089318 commit 490f13b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/protocol/http1/connection.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def read_line
173173
read_line? or raise EOFError
174174
end
175175

176-
def read_request_preface
176+
def read_request_line
177177
return unless line = read_line?
178178

179179
if match = line.match(REQUEST_LINE)
@@ -186,7 +186,7 @@ def read_request_preface
186186
end
187187

188188
def read_request
189-
method, path, version = read_request_preface
189+
method, path, version = read_request_line
190190
return unless method
191191

192192
headers = read_headers
@@ -200,7 +200,7 @@ def read_request
200200
return headers.delete(HOST), method, path, version, headers, body
201201
end
202202

203-
def read_response_preface
203+
def read_status_line
204204
version, status, reason = read_line.split(/\s+/, 3)
205205

206206
status = Integer(status)
@@ -209,7 +209,7 @@ def read_response_preface
209209
end
210210

211211
def read_response(method)
212-
version, status, reason = read_response_preface
212+
version, status, reason = read_status_line
213213

214214
headers = read_headers
215215

0 commit comments

Comments
 (0)