Skip to content

Commit ff94412

Browse files
committed
Persistent can only transition from true to false.
1 parent 0b176f2 commit ff94412

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/protocol/http1/connection.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,11 @@ def read_request
320320

321321
headers = read_headers
322322

323-
@persistent = persistent?(version, method, headers)
323+
# If we are not persistent, we can't become persistent even if the request might allow it:
324+
if @persistent
325+
# In other words, `@persistent` can only transition from true to false.
326+
@persistent = persistent?(version, method, headers)
327+
end
324328

325329
body = read_request_body(method, headers)
326330

0 commit comments

Comments
 (0)