Skip to content

Commit

Permalink
Update connection.rb
Browse files Browse the repository at this point in the history
Follow the naming conventions of the RFC.
  • Loading branch information
ioquatix committed Dec 26, 2023
1 parent 3089318 commit 490f13b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/protocol/http1/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def read_line
read_line? or raise EOFError
end

def read_request_preface
def read_request_line
return unless line = read_line?

if match = line.match(REQUEST_LINE)
Expand All @@ -186,7 +186,7 @@ def read_request_preface
end

def read_request
method, path, version = read_request_preface
method, path, version = read_request_line
return unless method

headers = read_headers
Expand All @@ -200,7 +200,7 @@ def read_request
return headers.delete(HOST), method, path, version, headers, body
end

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

status = Integer(status)
Expand All @@ -209,7 +209,7 @@ def read_response_preface
end

def read_response(method)
version, status, reason = read_response_preface
version, status, reason = read_status_line

headers = read_headers

Expand Down

0 comments on commit 490f13b

Please sign in to comment.