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 authored Dec 26, 2023
1 parent 7ee6ac0 commit f28c066
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 @@ -156,7 +156,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 @@ -169,7 +169,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 @@ -183,7 +183,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 @@ -192,7 +192,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 f28c066

Please sign in to comment.