Skip to content

Commit f28c066

Browse files
authored
Update connection.rb
Follow the naming conventions of the RFC.
1 parent 7ee6ac0 commit f28c066

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/protocol/http1/connection.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def read_line
156156
read_line? or raise EOFError
157157
end
158158

159-
def read_request_preface
159+
def read_request_line
160160
return unless line = read_line?
161161

162162
if match = line.match(REQUEST_LINE)
@@ -169,7 +169,7 @@ def read_request_preface
169169
end
170170

171171
def read_request
172-
method, path, version = read_request_preface
172+
method, path, version = read_request_line
173173
return unless method
174174

175175
headers = read_headers
@@ -183,7 +183,7 @@ def read_request
183183
return headers.delete(HOST), method, path, version, headers, body
184184
end
185185

186-
def read_response_preface
186+
def read_status_line
187187
version, status, reason = read_line.split(/\s+/, 3)
188188

189189
status = Integer(status)
@@ -192,7 +192,7 @@ def read_response_preface
192192
end
193193

194194
def read_response(method)
195-
version, status, reason = read_response_preface
195+
version, status, reason = read_status_line
196196

197197
headers = read_headers
198198

0 commit comments

Comments
 (0)