lib/async/http/protocol/http1/server.rb in async-http-0.64.2 vs lib/async/http/protocol/http1/server.rb in async-http-0.65.0
- old
+ new
@@ -1,25 +1,26 @@
# frozen_string_literal: true
# Released under the MIT License.
-# Copyright, 2018-2023, by Samuel Williams.
+# Copyright, 2018-2024, by Samuel Williams.
# Copyright, 2020, by Igor Sidorov.
# Copyright, 2023, by Thomas Morgan.
+# Copyright, 2024, by Anton Zhuravsky.
require_relative 'connection'
module Async
module HTTP
module Protocol
module HTTP1
class Server < Connection
def fail_request(status)
@persistent = false
- write_response(@version, status, {}, nil)
+ write_response(@version, status, {})
write_body(@version, nil)
rescue Errno::ECONNRESET, Errno::EPIPE
- # Handle when connection is already closed
+ # Nothing we can do...
end
def next_request
# The default is true.
return unless @persistent
@@ -107,10 +108,9 @@
ensure
body&.close(error)
end
end
end
-
end
end
end
end
end