From f28c0662d5de0fba94623a9877333318cb6fe7d8 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Wed, 27 Dec 2023 01:14:47 +1300 Subject: [PATCH] Update connection.rb Follow the naming conventions of the RFC. --- lib/protocol/http1/connection.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/protocol/http1/connection.rb b/lib/protocol/http1/connection.rb index 4eac51a..c3d092b 100644 --- a/lib/protocol/http1/connection.rb +++ b/lib/protocol/http1/connection.rb @@ -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) @@ -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 @@ -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) @@ -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